Req #45684 [Opn->Asn]: A request for foreach to be key-type agnostic.
| From: | nikic@php.net | Date: | Tue, 05 Jun 2012 22:24:11 +0000 |
| Subject: | Req #45684 [Opn->Asn]: A request for foreach to be key-type agnostic. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171051@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=45684&edit=1
ID: 45684
Updated by: nikic@php.net
Reported by: puts dot email at gmail dot com
Summary: A request for foreach to be key-type agnostic.
-Status: Open
+Status: Assigned
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: N/A
PHP Version: 5.3.0alpha1
-Assigned To:
+Assigned To: colder
Block user comment: N
Private report: N
New Comment:
Assigning to Etienne as he's working on this.
Previous Comments:
------------------------------------------------------------------------
[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?
------------------------------------------------------------------------
[2010-01-21 19:19:04] bytebrite at gmail dot com
This would be a nice addition. What technical issues are preventing this functionality from being
realized?
------------------------------------------------------------------------
[2009-12-16 02:29:33] tejas dot net+php at gmail dot com
Agreed. Its cool that 5.3 has the ArrayAccess interface, but key() not
being able to return objects really gets in the way.
------------------------------------------------------------------------
[2009-03-12 17:38:25] fqqdk at freemail dot hu
I don't see why ArrayAccess can allow objects (or anything) as array
keys, and Iterator doesn't. This is inconsistent.
------------------------------------------------------------------------
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