Edit report at https://bugs.php.net/bug.php?id=45684&edit=1
ID: 45684
Comment by: stoffle at gmail dot com
Reported by: puts dot email at gmail dot com
Summary: A request for foreach to be key-type agnostic.
Status: Assigned
Type: Feature/Change Request
Package: *General Issues
Operating System: N/A
PHP Version: 5.3.0alpha1
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
That's great, thanks for the update. I can now also remove my botched attempt from
GitHub :)
Previous Comments:
------------------------------------------------------------------------
[2013-02-24 11:00:02] nikic@php.net
@stoffle: I have an RFC and patch here: https://wiki.php.net/rfc/foreach-non-scalar-keys.
I'll try to get it into 5.5.
------------------------------------------------------------------------
[2013-02-24 03:04:21] stoffle at gmail dot com
Is there any chance this might make it into 5.5?
------------------------------------------------------------------------
[2012-06-05 22:24:11] nikic@php.net
Assigning to Etienne as he's working on this.
------------------------------------------------------------------------
[2011-04-05 19:26:00] info at strictcoding dot co dot uk
Agreed, it would be a very nice addition, this is currently a blocking issue for
doing some cool stuff.
------------------------------------------------------------------------
[2010-09-23 11:22:06] mep_eisen at web dot de
I don't get the point why ArrayAccess allowes object as keys (which is very nice) but Iterator
does not allow it.
I use proxy objects to store instances during serialization and connect them to a single object
instance during unserialization. Having those proxies as keys in arrays would be really nice.
SplObjectStorage does not work because multiple proxies that are connected to the same underlying
object instance will always be different keys for SplObjectStorage.
What's about the feature request? Any news?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=45684--
Edit this bug report at https://bugs.php.net/bug.php?id=45684&edit=1