[PHP-DOC] #19080 [NEW]: Docs not clear on the diff between isset() and array_key_exists() From: andrey <email protected>
Date: 08/23/02

From: andrey <email protected>
Operating system: All
PHP version: 4.2.2
PHP Bug Type: Documentation problem
Bug description: Docs not clear on the diff between isset() and array_key_exists()

 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 bug report at http://bugs.php.net/?id=19080&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19080&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19080&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19080&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19080&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19080&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19080&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19080&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19080&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19080&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19080&r=globals

-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php