Re: foreach, assigning to a reference, and E_NOTICE
| From: | Paul Reinheimer | Date: | Thu, 09 Mar 2006 17:49:11 +0000 |
| Subject: | Re: foreach, assigning to a reference, and E_NOTICE | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-22299@lists.php.net to get a copy of this message | ||
Being the colleague Sean refered to in his first post I thought I
might weigh in.
While I agree that once I looked at the base case that Sean worked out
of my code the problem didn't take too long to recognize, that's not
where I first experianced the problem. Problems first rear their head
deep within your code, looking at it there I had no idea what was
going on, all I could tell was that for some reason I was getting two
copies of an object in a foreach loop (I hadn't yet noticed that I was
missing one).
Once Sean was able to break my code down into the simple base case and
replicate the issue I understood what was happening, but just looking
at my code as a whole? Not a chance.
A warning on strict or or notice would have helped a lot, and that's
really what I think a lot of those messages are, notices to the
programmer that something odd /may/ happen.
as a side note, running the zend code analyzer did not give me any
warnings either.
paul