On 28 June 2011 18:08, Dave Ingram <d...@dmi.me.uk> wrote: > So what about modifying the loop syntax slightly, to explicitly scope a > variable in a foreach? Or would this be problematic/counter-intuitive too? > > foreach ($abc as var $def) { > } > > and > > foreach ($abc as var &$def) { > }
PHP's scoping behaviour — particularly around foreach loops and references — confuses the hell out of people already. I don't think adding another optional mode that's triggered by a keyword is going to make that any less confusing, frankly. Adam -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php