note 36472 added to function.array-key-exists
| From: | jeff at procata dot com | Date: | Fri, 10 Oct 2003 19:55:29 +0000 |
| Subject: | note 36472 added to function.array-key-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58208@lists.php.net to get a copy of this message | ||
In PHP 4.1.2, passing a NULL for the first parameter will result in an error:
Wrong datatype for first argument in call to array_key_exists
By 4.3.2 this message has been removed.
use short circuit operators to emulate the more current behavior under older versions of PHP:
(is_null($key) || !array_key_exists($key, $search))
----
Manual Page -- http://www.php.net/manual/en/function.array-key-exists.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36472
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36472&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36472&report=yes
Search -- http://master.php.net/manage/user-notes.php