#46354 [Opn->Bgs]: array_key_exists() vs. ArrayObject

From: Date: Tue, 21 Oct 2008 09:20:40 +0000
Subject: #46354 [Opn->Bgs]: array_key_exists() vs. ArrayObject
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129916@lists.php.net to get a copy of this message
 ID:          46354
 Updated by:  jani@php.net
-Summary:     Array_key_exists vs. ArrayObject
 Reported By: david at grudl dot com
-Status:      Open
+Status:      Bogus
 Bug Type:    SPL related
 PHP Version: 5.3CVS-2008-10-21 (snap)
 New Comment:

Expected behaviour, object is not an array.


Previous Comments:
------------------------------------------------------------------------

[2008-10-21 08:18:02] david at grudl dot com

Description:
------------
Array_key_exists accepts ArrayObject since PHP 5.0.0, but 5.3.0 refuse
it. Feature or bug?

Reproduce code:
---------------
$arr = array('a' => 10);

$obj = new ArrayObject($arr);

echo array_key_exists('a', $obj);


Expected result:
----------------
TRUE

Actual result:
--------------
Warning: array_key_exists() expects parameter 2 to be array, object
given
NULL


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46354&edit=1



Thread (2 messages)

« previous php.bugs (#129916) next »