|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43650 Objects implementing ArrayAccess don't work with array_* functions
Submitted: 2007-12-21 09:18 UTC Modified: 2011-04-08 21:05 UTC
Avg. Score:4.6 ± 0.8
Reproduced:12 of 12 (100.0%)
Same Version:3 (25.0%)
Same OS:4 (33.3%)
From: Assigned:
Status: Open Package: SPL related
PHP Version: 5.2.5 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.
Bug Type:
New email:
PHP Version: OS:


 [2007-12-21 09:18 UTC]
Objects of classes implementing ArrayAccess (e.g. ArrayObject) cannot be used with array_* functions like array_multisort. It would be cool if PHP would allow this.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-21 09:20 UTC]
(Feature request from
 [2011-04-08 21:05 UTC]
-Summary: SPL: Objects implementing ArrayAccess don't work with array_* functions +Summary: Objects implementing ArrayAccess don't work with array_* functions -Package: Feature/Change Request +Package: SPL related
 [2011-11-19 21:06 UTC] morrison dot levi at gmail dot com
Agree on this, even though you can make this work in other ways.  You can have a 
method that takes a function as a parameter and will call it with a reference (if 
applicable) to your data.  It still feels hackish when they can already access all 
my data.
 [2020-12-27 05:50 UTC] cameron7 at gmail dot com
Use case: For example, I think it might be pretty cool if stream_select allowed ArrayAccess objects to be passed as arguments.
 [2020-12-27 06:01 UTC] cameron7 at gmail dot com
nm re: previous post, looks like it's ArrayIterator I was looking for :)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 00:01:32 2024 UTC