#19080 [NEW]: Docs not clear on the diff between isset() and array_key_exists()

From: Date: Fri, 23 Aug 2002 23:20:28 +0000
Subject: #19080 [NEW]: Docs not clear on the diff between isset() and array_key_exists()
Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-17702@lists.php.net to get a copy of this message
From: andrey@webgate.bg 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

« previous php.bugs (#17702) next »