rfc:objkey

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:objkey [2014/10/27 00:21] stasrfc:objkey [2015/01/11 00:36] stas
Line 1: Line 1:
 ====== PHP RFC: Objects as hash keys ====== ====== PHP RFC: Objects as hash keys ======
-  * Version: 0.9 +  * Version: 1.0 
-  * Date: 2014-10-21+  * Date: 2014-10-26
   * Author: Stas Malyshev (stas@php.net), krakjoe   * Author: Stas Malyshev (stas@php.net), krakjoe
-  * Status: Draft +  * Status: Declined
   * First Published at: http://wiki.php.net/rfc/objkey   * First Published at: http://wiki.php.net/rfc/objkey
  
Line 82: Line 82:
 </code> </code>
  
-The current behavior of __toString is unchanged.+The current behavior of %%__toString%% is unchanged.
  
 ==== Backward Incompatible Changes ===== ==== Backward Incompatible Changes =====
Line 104: Line 104:
 Since objects are run-time, should not have any effects on opcache. Since objects are run-time, should not have any effects on opcache.
  
-==== New Constants ==== 
  
-None.+===== Open Issues =====
  
-==== php.ini Defaults ==== +  - Should SplFixedArray support object indexes? 
- +  - Should SplObjectStorage support calling %%__hash%% for an object if it exists? 
-None. +
- +
-===== Open Issues =====+
  
-Should this be supported for strings? I don't think it makes much sense but mentioning it here for completeness sake. 
  
-===== Proposed Voting Choices =====+===== Vote =====
  
-New magic method requires 2/3 majority. We may also have choices on if we want to name it %%__hash%% or %%__toKey%% or something else+New magic method requires 2/3 majority. The vote also includes choice for the name %%__hash%% or %%__toKey%%. Vote for either is counted as the vote for the proposal
  
-===== Patches and Tests =====+<doodle title="Should we support using objects as keys as described in this proposal?" auth="stas" voteType="single" closed="true"> 
 +   * Yes, via method __hash 
 +   * Yes, via method __toKey 
 +   * No 
 +</doodle>
  
-http://github.com/krakjoe/php-src/compare/hashkey+The vote runs from December 16, 2014 to the end of day (PDT) January 6, 2015
  
 ===== Implementation ===== ===== Implementation =====
  
-TBD+https://github.com/php/php-src/pull/881
  
 ===== References ===== ===== References =====
Line 134: Line 133:
 ===== Rejected Features ===== ===== Rejected Features =====
  
-Using %%_toString%% for the key conversion, for the reasons discussed above. + Using %%__toString%%  for the key conversion, for the reasons discussed above.  
 + - Supporting the use of objects for string indexes
rfc/objkey.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1