Re: foreach weirdness

From: Date: Fri, 23 Mar 2012 22:30:22 +0000
Subject: Re: foreach weirdness
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-317241@lists.php.net to get a copy of this message
2012/3/23 Robert Cummings <robert@interjinn.com> > > On 12-03-23 11:16 AM, Arno Kuhl wrote: >> >> >> it still does not produce the correct result: >> 0 1 3 6 10 15 21 >> 0 1 3 6 10 15 15 > > > This looks like a bug... the last row should be the same. What version of > PHP are you using? Have you checked the online bug reports? > > Hi, Robert Does not seem like a bug to me ... http://schlueters.de/blog/archives/141-References-and-foreach.html What you should do to get the expected result: Unset the variable after you don't need this reference any longer. Bye Simon

« previous php.general (#317241) next »