php.net |  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
Votes:13
Avg. Score:4.6 ± 0.8
Reproduced:12 of 12 (100.0%)
Same Version:3 (25.0%)
Same OS:4 (33.3%)
From: cweiske@php.net Assigned:
Status: Open Package: SPL related
PHP Version: 5.2.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
6 + 46 = ?
Subscribe to this entry?

 
 [2007-12-21 09:18 UTC] cweiske@php.net
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-21 09:20 UTC] cweiske@php.net
(Feature request from http://bugs.php.net/bug.php?id=34849)
 [2011-04-08 21:05 UTC] jani@php.net
-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: Fri Apr 19 13:01:30 2024 UTC