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.
> 
> [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.

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
arrays/objects.

Then Zend could remove the silly question from the cert example exam ;).

Greg

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to