php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38694 allow objects to be array keys
Submitted: 2006-09-02 22:02 UTC Modified: 2006-09-04 18:39 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jerdonek at gmail dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.1.6 OS: Mac OS X 10.4.7
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: jerdonek at gmail dot com
New email:
PHP Version: OS:

 

 [2006-09-02 22:02 UTC] jerdonek at gmail dot com
Description:
------------
Arrays and objects are not currently allowed as keys.

Instead of:

$values[$object] = 0;

the programmer is forced to create string or integer keys for 
all objects we want to use as keys:

$values[$object->id] = 0;

I'm sure this has been mentioned before, but I couldn't find 
anything in the feature requests.  So I am making a formal 
request.  I know Python and Ruby allow this.  Thanks.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-04 18:39 UTC] jerdonek at gmail dot com
Won't fix ever?  What's the rationale?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 00:01:27 2024 UTC