Sean Coates wrote:
it's not the problem of the second foreach, any usage of $j after the
1st foreach as &$j will hurt

Yes. I thought it was clear that I understand this. I guess not.

My point is that foreach is doing something that isn't immediately
obvious. The same is true of your for loop, but to a lesser extent, IMO
(as I don't expect your for loop to ONLY read from $i).

I don't want to start a discussion on references. I'm just trying to
clear up a non-obvious case.

How would you supress the notice (I know error suppression is ugly), but we need to make it possible for people to quickly adapt to this change if they indeed relied on this.

would this work:
foreach ($i as @&$j) {}

regards,
Lukas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to