Re: bug when using foreach with references?

From: Date: Mon, 16 Nov 2009 11:07:02 +0000
Subject: Re: bug when using foreach with references?
Groups: php.internals 
Request: Send a blank email to internals+get-46051@lists.php.net to get a copy of this message
It would be arbitrarily breaking an explicit reference. I know I have code lying around that relies on multiple loops cleaning up a big complicated multi-level array. I do ugly things with references into that array and it would completely break if PHP magically deleted my references whether they are in the iterator or elsewhere. This has been this way for 6+ years and it is well documented on the http://php.net/foreach page. (see the big red warning box)
Even though, that's a language issue. Why the hell in php the foreach do not capture the variable properly?
-Rasmus
Fair enough. Thanks for examining it again with me. Best, Richard -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- • *Mathieu Suen* | It Team | www.easyflirt.com • mathieu [dot] suen [at] easyflirt [dot] com • EasyFlirt - Park Nord, Les Pléiades, 74370 - Metz-Tessy - FRANCE • Pensez à l'environnement, n'imprimez cet e-mail qu'en cas de réelle nécessité

« previous php.internals (#46051) next »