note 45562 rejected from function.key by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 10 Sep 2004 22:59:07 +0000 |
| Subject: | note 45562 rejected from function.key by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76432@lists.php.net to get a copy of this message | ||
Note Submitter: al_the_x at yahoo dot com
----
While this may go without saying for most of us, it is note-worthy that the value returned by key()
when called upon an empty array evaluates equal to the empty string. That is, in the following
example:
$newArray = array();
if (key($newArray) == "") echo "True";
else echo "False";
"True" is output.
Not rocket science, but omitted from the documentation above.