#49889 [Opn->Asn]: offsetExists wrong result

From: Date: Thu, 22 Oct 2009 18:05:47 +0000
Subject: #49889 [Opn->Asn]: offsetExists wrong result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143805@lists.php.net to get a copy of this message
ID: 49889 Updated by: felipe@php.net Reported By: carmen at helderhosting dot nl -Status: Open +Status: Assigned Bug Type: SPL related Operating System: unix PHP Version: 5.3.0 -Assigned To: +Assigned To: colder Previous Comments: ------------------------------------------------------------------------ [2009-10-15 12:31:07] carmen at helderhosting dot nl Description: ------------ If $o = new ArrayObject(); $o['x'] = null; the result for isset($o['x']) it should be false, instead true is given Reproduce code: --------------- <?php $a = array(); $a['x'] = null; var_dump(isset($a['x'])); var_dump(empty($a['x'])); var_dump(array_key_exists('x', $a)); $o = new ArrayObject(); $o['x'] = null; var_dump($o->offsetExists('x')); var_dump(isset($o['x'])); var_dump(empty($o['x'])); var_dump(array_key_exists('x', $o)); ?> Expected result: ---------------- bool(false) bool(true) bool(true) bool(true) bool(false) bool(true) bool(true) Actual result: -------------- bool(false) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49889&edit=1

« previous php.bugs (#143805) next »