Re: Re: foreach with null

From: Date: Wed, 26 Oct 2005 19:36:48 +0000
Subject: Re: Re: foreach with null
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-19740@lists.php.net to get a copy of this message
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'd like to see E_STRICT be used for this
    if this NULL thing is accepted. Also, I found out recently something
    that I didn't know about before and which I count as inconsistent:
    count(<somethingthatisnotanemptyarraynorobjectnornull>) returns int(1).
    It would be nice that count() would also produce an E_STRICT notice
    when passed something else than object or array. Or rather make
    every single function and language construct to produce the E_STRICT
    notice when passed wrong type of variable.
    --Jani


« previous php.internals (#19740) next »