Zeev Suraski wrote: > Log: > Support references in foreach() > Syntax: > foreach ($arr as &$val) > foreach ($arr as $key => &$val)
Does this mean that before this patch
foreach ($arr as $val) {}
did not put a reference in $val but a copy (clone)?
A copy, yes. Using 'clone' here is a bit misleading though, it didn't call __clone or anything. For objects under PHP 5, this doesn't make too much of a difference. For everything else, it does.
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php