rfc:spread_operator_for_array

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
Next revisionBoth sides next revision
rfc:spread_operator_for_array [2019/04/05 13:35] – more example jhdxrrfc:spread_operator_for_array [2019/04/21 19:35] jhdxr
Line 3: Line 3:
   * Date: 2018-10-13   * Date: 2018-10-13
   * Author: CHU Zhaowei, jhdxr@php.net   * Author: CHU Zhaowei, jhdxr@php.net
-  * Status: Under discussion+  * Status: Voting
   * First Published at: http://wiki.php.net/rfc/spread_operator_for_array   * First Published at: http://wiki.php.net/rfc/spread_operator_for_array
  
Line 36: Line 36:
 } }
 $arr6 = [...getArr(), 'c']; //['a', 'b', 'c'] $arr6 = [...getArr(), 'c']; //['a', 'b', 'c']
 +
 +$arr7 = [...new ArrayIterator(['a', 'b', 'c'])]; //['a', 'b', 'c']
 +
 +function arrGen() {
 + for($i = 11; $i < 15; $i++) {
 + yield $i;
 + }
 +}
 +$arr8 = [...arrGen()]; //[11, 12, 13, 14]
 </code> </code>
  
Line 99: Line 108:
 ===== RFC Impact ===== ===== RFC Impact =====
 ==== To Opcache ==== ==== To Opcache ====
-I'm not sure if this RFC will have any impact on Opcache. I'll check it after I finish the patch.+Some changes in opcache to support the new opcode is needed.
  
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-As this is a language change, a 2/3 majority is required. +Voting started 2019-04-22 and ends 2019-05-06. A 2/3 majority is required. 
 + 
 +<doodle title="Support spread operator for array definition in PHP 7.4?" auth="jhdxr" voteType="single" closed="false"> 
 +   * Yes 
 +   * No 
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
rfc/spread_operator_for_array.txt · Last modified: 2019/05/13 12:45 by nikic