Can we throw an E_NOTICE when foreach targets a reference? (The other
there's many way to use reference, not only in foreach. don't do
reference unless u know it's really needed.

Sean's not so much referring to his own problem as (like you said) the solution is a fairly simple matter of following strict coding practices. He's trying to address the problem of unexperienced developers seeing this behavior and (wrongly) reporting it as a bug, or worse, assuming PHP is just "broken" and therefore shouldn't be used.

That said, I'm not convinved this needs a notice, but I'm certainly not against it. Perhaps we should split the difference with an E_STRICT.

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

Reply via email to