$a = array(1, 2, 3);
foreach ($a as $v) {
var_dump(current($a));
}
// Output: int(2) int(2) int(2)
$a = array(1, 2, 3);
$b = &$a;
foreach ($a as $v) {
var_dump(current($a));
}
// Output: int(2) int(3) bool(false)
$a = array(1, 2, 3);
$b = $a;
foreach ($a as $v) {
var_dump(current($a));
}
// Output: int(1) int(1) int(1)
答案 0 :(得分:1)