#19080 [Opn->Csd]: Docs not clear on the diff between isset() and array_key_exists()
| From: | kalowsky@php.net | Date: | Wed, 28 Aug 2002 16:25:00 +0000 |
| Subject: | #19080 [Opn->Csd]: Docs not clear on the diff between isset() and array_key_exists() | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-18048@lists.php.net to get a copy of this message | ||
ID: 19080
Updated by: kalowsky@php.net
Reported By: andrey@webgate.bg
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: All
PHP Version: 4.2.2
New Comment:
There is an example in the docs explaining the difference between this
on the isset() page.
Previous Comments:
------------------------------------------------------------------------
[2002-08-23 19:20:27] andrey@webgate.bg
Hello,
this code :
<?php
$a = array(1=>NULL);
var_dump($a);
var_dump(isset($a[1]));
var_dump(array_key_exists(1,$a));
?>
Produces this :
array(1) {
[1]=>
NULL
}
bool(false)
bool(true)
So for first time I see difference in the use of isset() and
array_key_exists(). Many users (including me till 1 one ago) believe
that they are equivalent and because isset() is shorter it is mostly
used.
Should be there any notice in the docs about this issue?
This code is correct and the bug report was inspired by note to do this
by jmcastagnetto.
Regards,
Andrey
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19080&edit=1