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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri May 17 22:01:31 2024 UTC