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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cweiske@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Nov 21 17:01:32 2024 UTC