note 91275 deleted from function.empty by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Jun 2009 12:54:43 +0000 |
| Subject: | note 91275 deleted from function.empty by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156320@lists.php.net to get a copy of this message | ||
Note Submitter: aleczapka at gmx dot net
----
The behaviour of this function is either bugged or badly documented.
Consider this input array:
Array
(
[0] => Array
(
[0] => \K6
[1] => 10
)
[1] => Array
(
[0] => 6
[1] => 12
)
)
Even though var_dump(empty($array)) will return 'boolean false', the code below will never
work.
if (!empty($array))
{
// do something - but this part will never be reached
}
This works though:
if (empty($array) !== false)
{
//do something - now this works
}