Re: Re: PHP 4.0 Bug #6117 Updated: next() fails when it reaches a "0" key

From: Date: Fri, 11 Aug 2000 19:12:11 +0000
Subject: Re: Re: PHP 4.0 Bug #6117 Updated: next() fails when it reaches a "0" key
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-28648@lists.php.net to get a copy of this message
Ronen Botzer wrote: > Actually, the integer key 0 should not be equivalent to the boolean value > 'false'. Maybe a little use of === is in place in next() ? But an integer 0 is considered false. And the next has nothing to do with it. > > > Further, for and foreach are synonimous constructs, and syntactic sugar > should not produce differing results. When it comes down to run time > compilation both of these constructs should act the same. for and foreach are not synonimous constucts, they only "look" like each other. Because the constucts are different, these constructs don't act the same. > > Therefore, this IS a bug, and instead of dismissing it and closing it > immediately, maybe it should be noted for a fix in a future revision. It is not a bug as I said > > > Thanks, > Ronen. > > On 12 Aug 2000, Bug Database wrote: > > Date: 12 Aug 2000 06:26:52 -0000 > > To: ronen@greyzone.com > > From: Bug Database <php-dev@lists.php.net> > > Subject: PHP 4.0 Bug #6117 Updated: next() fails when it reaches a "0" > > key > > > > ID: 6117 > > Updated by: derick > > Reported By: ronen@greyzone.com > > Status: Closed > > Bug Type: Misbehaving function > > Assigned To: > > Comments: > > > > It is not a bug, but a feature. > > > > When $key=key($test) matches false ("0" is considered false), the loop > > ends. That's normal behaviour. > > > > Full Bug description available at: > > http://bugs.php.net/?id=6117 > > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Derick Rethans JDI Media Solutions H.v.Tussenbroekstraat 1 6952 BL Dieren The Netherlands e-mail: d.rethans@jdimedia.nl http://www.jdimedia.nl/

« previous php.dev (#28648) next »