rfc:negative_array_index

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
rfc:negative_array_index [2018/02/12 18:09] – Prepare for new discussion pmmagarfc:negative_array_index [2020/08/01 23:40] (current) – RFC was implemented in both PHP 7.4 and PHP 8.0 carusogabriel
Line 3: Line 3:
   * Date: 2017-04-20   * Date: 2017-04-20
   * Author: Pedro Magalhães, pmmaga@php.net   * Author: Pedro Magalhães, pmmaga@php.net
-  * Status: Under Discussion+  * Status: Implemented
   * First Published at: http://wiki.php.net/rfc/negative_array_index   * First Published at: http://wiki.php.net/rfc/negative_array_index
  
Line 78: Line 78:
  
 if ($a[1] === true) { if ($a[1] === true) {
-    echo 'Accessing key 1 explicitly.';+    echo 'Accessing key 1 explicitly';
 } }
 </code> </code>
  
-Will no longer produce any output.+Will no longer output ''Accessing key 1 explicitly''. 
 + 
 +<blockquote> 
 +NOTE: If accepted, during the deprecation phase the ''E_DEPRECATED'' notice mentioned in the previous section would be emitted. 
 +</blockquote>
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 89: Line 93:
  
 ===== Unaffected PHP Functionality ===== ===== Unaffected PHP Functionality =====
-Arrays with explicit keys, string keys, or an initial numeric index ''>0'' are not affected. This also means that arrays that never use explicit keys will still start with ''0''.+Arrays with explicit keys, string keys, or an initial numeric index ''>-1'' are not affected. This also means that arrays that never use explicit keys will still start with ''0''.
  
 Furthermore, iterating over arrays without explicit keys (ie. ''foreach'') is not affected. Furthermore, iterating over arrays without explicit keys (ie. ''foreach'') is not affected.
  
 ===== Voting Choices ===== ===== Voting Choices =====
-This RFC requires a 2/3 majority.+Both votes require a 2/3 majority.
  
 <doodle title="Arrays starting with a negative index for 8.0" auth="pmmaga" voteType="single" closed="true"> <doodle title="Arrays starting with a negative index for 8.0" auth="pmmaga" voteType="single" closed="true">
Line 116: Line 120:
  
 ===== References ===== ===== References =====
 +Version 0.3:
 +
 Discussion on the mailing list: https://externals.io/message/98302 Discussion on the mailing list: https://externals.io/message/98302
  
Line 122: Line 128:
 Second proposal Voting period discussion: https://externals.io/message/99511 Second proposal Voting period discussion: https://externals.io/message/99511
  
 +----
 +Version 0.4:
 +
 +Discussion on the mailing list: https://externals.io/message/101861
rfc/negative_array_index.1518458971.txt.gz · Last modified: 2018/02/12 18:09 by pmmaga