Re: [PHP-DEV] Re: foreach with null

2005-10-27 Thread Jani Taskinen
On Wed, 26 Oct 2005, Ilia Alshanetsky wrote: Greg Beaver wrote: amen, this behavior makes no sense even though sizeof() is an alias to count(). sizeof('this') and sizeof('this long thing') are both 1, which makes no sense. I would go so far as to say a E_NOTICE is more appropriate than E_STR

Re: [PHP-DEV] Re: foreach with null

2005-10-26 Thread Greg Beaver
Ilia Alshanetsky wrote: > Greg Beaver wrote: > >>amen, this behavior makes no sense even though sizeof() is an alias to >>count(). sizeof('this') and sizeof('this long thing') are both 1, which >>makes no sense. I would go so far as to say a E_NOTICE is more >>appropriate than E_STRICT - you sho

Re: [PHP-DEV] Re: foreach with null

2005-10-26 Thread Ilia Alshanetsky
Greg Beaver wrote: > amen, this behavior makes no sense even though sizeof() is an alias to > count(). sizeof('this') and sizeof('this long thing') are both 1, which > makes no sense. I would go so far as to say a E_NOTICE is more > appropriate than E_STRICT - you should only be using count() for

Re: [PHP-DEV] Re: foreach with null

2005-10-26 Thread Greg Beaver
Jani Taskinen wrote: > On Wed, 26 Oct 2005, Sebastian wrote: > > [clip] > >> Good code is code that's easy to debug (among other things). By >> removing the "Invalid argument supplied for foreach()" warning without >> providing mechanisms to turn it on, debugging code will be more >> difficult. >

Re: [PHP-DEV] Re: foreach with null

2005-10-26 Thread Jani Taskinen
On Wed, 26 Oct 2005, Sebastian wrote: [clip] Good code is code that's easy to debug (among other things). By removing the "Invalid argument supplied for foreach()" warning without providing mechanisms to turn it on, debugging code will be more difficult. [clip] You got to the point here. I

Re: [PHP-DEV] Re: foreach with null

2005-10-26 Thread Markus Fischer
Sebastian wrote: Good code is code that's easy to debug (among other things). By removing the "Invalid argument supplied for foreach()" warning without providing mechanisms to turn it on, debugging code will be more difficult. Logically speaking, when does it make sense to iterate over something

RE: [PHP-DEV] Re: foreach with null

2005-10-24 Thread David Zülke
> IMPW (In my PHP world) null represents an undefined variable. Trying to > iterate over it could be a programming mistake. Like iterating over a > scalar value. I normally use foreach ((array)$var as $value) if $var is > of "mixed" type which also catches null. But most of the time I'm more > comf