Re: array_key_exists BC break
| From: | David Grudl | Date: | Fri, 24 Oct 2008 14:01:36 +0000 |
| Subject: | Re: array_key_exists BC break | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41368@lists.php.net to get a copy of this message | ||
Hello,
I have reported this bug http://bugs.php.net/bug.php?id=46354, because new behaviour breaks my script. The question is how fix scripts for new behaviour. Example:
// common array
$a = array('item' => NULL);
isset($a['item']) -> FALSE
array_key_exists($a['item']) -> TRUE
// ArrayObject
$o = new ArrayObject($a);
isset($o['item']) -> TRUE (!)
$o->offsetExists($o['item']) -> TRUE (!), in PHP 5.2.1 FALSE (!)
Should one rely on this 'isset' behaviour, i.e. will isset($a['item']) return TRUE in future?
David Grudl