Hi,

I came across this:

echo sizeof(array());
echo sizeof("");
$a = "";
var_dump( empty($a));
$a = array();
var_dump(empty($a));

So funny! How something can have a size greater than 0 but still be empty?
I think PHP is reinventing the inconsistency word.

But then let assume that empty is just making a cast in array.
$a = "";
empty($a) //true
empty((array)$a) //false

Ok so empty is big ugly switch case on type.

empty(0); //true
empty(45); //false

Wooow reinventing emptiness on number....

-- Mathieu Suen

        


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

Reply via email to