php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46354 array_key_exists() vs. ArrayObject
Submitted: 2008-10-21 08:18 UTC Modified: 2008-10-21 09:20 UTC
From: david at grudl dot com Assigned:
Status: Not a bug Package: SPL related
PHP Version: 5.3CVS-2008-10-21 (snap) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [2008-10-21 08:18 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-21 09:20 UTC] jani@php.net
Expected behaviour, object is not an array.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC