xiaozi 2015-03-14 13:31:42

php函数返回值为数组的时候,赋值不会重置数组内部指针。

function test()
{
	$arr2 = [1,2,3];
	foreach ($arr2 as $a) {}
	return $arr2;
}

$arr4 = test();
// bool(false)
var_dump(current($arr4));

评论

- 위키
Copyright © 2011-2024 iteam. Current version is 2.137.1. UTC+08:00, 2024-11-08 19:53
浙ICP备14020137号-1 $방문자$