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

From: Date: Fri, 11 Aug 2000 18:52:11 +0000
Subject: Re: PHP 4.0 Bug #6117 Updated: next() fails when it reaches a "0" key
Groups: php.dev 
Request: Send a blank email to php-dev+get-28640@lists.php.net to get a copy of this message
Actually, the integer key 0 should not be equivalent to the boolean value 'false'. Maybe a little use of === is in place in next() ? 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. 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. 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 > >

« previous php.dev (#28640) next »