#20865 [NEW]: array_key_exists(NULL, $myarray) generates warning and returns FALSE;
| From: | grubby_d at yahoo dot com | Date: | Fri, 06 Dec 2002 17:14:21 +0000 |
| Subject: | #20865 [NEW]: array_key_exists(NULL, $myarray) generates warning and returns FALSE; | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-26862@lists.php.net to get a copy of this message | ||
From: grubby_d@yahoo.com
Operating system: XP/IIS
PHP version: 4.2.3
PHP Bug Type: Unknown/Other Function
Bug description: array_key_exists(NULL, $myarray) generates warning and returns FALSE;
this is an self explanatory bug.
RUN THIS SCRIPT
<?php
$myarray = array(1, 2, 3);
$myarray[NULL] = "the null value";
print_r($myarray); //output includes [] => "the null value"
// can reference the null indexed value without problems
//The bug is in this function:
$result = array_key_exists(NULL, $myarray) //generates warning and returns
FALSE;
?>
I found the bug on redhat 7.3/apache.1.3.x with PHP verison 4.1.X but i
reproduced the same behaviour on the submitted platform (PHP4.2.3) to
comply with this bug report form.
--
Edit bug report at http://bugs.php.net/?id=20865&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20865&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20865&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20865&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20865&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20865&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20865&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20865&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20865&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20865&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20865&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20865&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20865&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20865&r=isapi