rfc:hashkey
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:hashkey [2014/10/22 13:48] – krakjoe | rfc:hashkey [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: __hashKey magic method ====== | + | Merged to rfc/objkey |
- | * Version: 0.9 | + | |
- | * Date: 2014-10-22 | + | |
- | * Author: Joe Watkins | + | |
- | * Status: Draft | + | |
- | * First Published at: http:// | + | |
- | + | ||
- | ===== Proposal ===== | + | |
- | A new magic __hashKey method, expected to return a scalar suitable for use as a HashTable key: | + | |
- | + | ||
- | <code php> | + | |
- | <?php | + | |
- | class Foo { | + | |
- | public function __hashKey() { | + | |
- | return __CLASS__; | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | $foo = new Foo(); | + | |
- | $test = [ | + | |
- | $foo => true | + | |
- | ]; | + | |
- | </ | + | |
- | + | ||
- | ===== Proposed PHP Version(s) ===== | + | |
- | 7 | + | |
- | + | ||
- | ===== Open Issues ===== | + | |
- | Make sure there are no open issues when the vote starts! | + | |
- | + | ||
- | ===== Proposed Voting Choices ===== | + | |
- | The language is changed, so requires a 2/3 majority to pass. | + | |
- | + | ||
- | A straight yes/no vote should be conducted. | + | |
- | + | ||
- | ===== Patches and Tests ===== | + | |
- | http:// | + | |
- | + | ||
- | ===== References ===== | + | |
- | Links to external references, discussions or RFCs | + | |
- | + | ||
- | ===== Rejected Features ===== | + | |
- | Keep this updated with features that were discussed on the mail lists. | + |
rfc/hashkey.1413985737.txt.gz · Last modified: 2017/09/22 13:28 (external edit)