Re: foreach with null

From: Date: Thu, 27 Oct 2005 10:47:35 +0000
Subject: Re: foreach with null
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-19759@lists.php.net to get a copy of this message
On Thu, 27 Oct 2005, Hannes Magnusson wrote: > On 10/27/05, Derick Rethans <derick@php.net> wrote: > > > > On Wed, 26 Oct 2005, Ilia Alshanetsky wrote: > > > > > IMHO this is a bad idea, if you really wanted to support NULL in a > > > particular case you, as a developer could do: > > > php -r '$n=NULL; foreach((array)$n as $v);' > > > > > > Making NULL usage transparent where array is expects will lead to > > > difficult to debug code. > > > > > > -1 for removing the warning. > > > > Yes, I agree, we should not remove this warning. > > +1 on *not* removing the warning. I can't see any reson why it should be > removed. Erm, that's what I meant. +1 with *not* is the same as -1 without.... Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

« previous php.internals (#19759) next »