rfc:iterator_xyz_accept_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
rfc:iterator_xyz_accept_array [2022/06/21 15:22] – copy-edit timwollarfc:iterator_xyz_accept_array [2022/07/19 14:47] (current) – Implemented. timwolla
Line 3: Line 3:
   * Date: 2022-06-21   * Date: 2022-06-21
   * Author: Tim Düsterhus, duesterhus@woltlab.com   * Author: Tim Düsterhus, duesterhus@woltlab.com
-  * Status: Under Discussion+  * Status: Implemented 
 +  * Target Version: PHP 8.2 
 +  * Implementation: https://github.com/php/php-src/commit/7ae7df5b4601f3f0ce45a27324fb9c6ebcbfc9ed
   * First Published at: http://wiki.php.net/rfc/iterator_xyz_accept_array   * First Published at: http://wiki.php.net/rfc/iterator_xyz_accept_array
  
Line 36: Line 38:
 Specifically if this RFC is accepted the following shall hold: Specifically if this RFC is accepted the following shall hold:
  
-====== iterator_to_array ======+==== iterator_to_array ====
  
 <PHP> <PHP>
Line 43: Line 45:
 </PHP> </PHP>
  
-====== iterator_count ======+==== iterator_count ====
  
 <PHP> <PHP>
Line 49: Line 51:
 </PHP> </PHP>
  
-====== iterator_apply ======+==== iterator_apply ====
  
 This function is **not** part of this proposal, because it is non-obvious how to define the behavior for <php>array</php>s, given that it does not pass the <php>Iterator</php> to the callback by default. This function is **not** part of this proposal, because it is non-obvious how to define the behavior for <php>array</php>s, given that it does not pass the <php>Iterator</php> to the callback by default.
Line 97: Line 99:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
-Each vote requires a 2/3 majority..+Each vote requires a 2/3 majority.
  
-  * Vote 1: Change the type of <php>iterator_to_array()</php>'<php>$iterator</php> parameter from <php>\Traversable</php> to <php>iterable</php>? +Voting opened 2022-07-05 14:30 UTC and closes on 2022-07-19 14:45 UTC. 
-  * Vote 2: Change the type of <php>iterator_count()</php>'<php>$iterator</php> parameter from <php>\Traversable</php> to <php>iterable</php>?+ 
 +<doodle title="iterator_to_array: Change the type of iterator_to_array()s $iterator parameter from \Traversable to iterable?" auth="timwolla" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle
 + 
 + 
 + 
 +<doodle title="iterator_count: Change the type of iterator_count()s $iterator parameter from \Traversable to iterable?" auth="timwolla" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
  
-PoC implementation to <php>iterator_to_array</php>: https://github.com/php/php-src/pull/8819+https://github.com/php/php-src/pull/8819
  
 ===== Implementation ===== ===== Implementation =====
  
-n/a+https://github.com/php/php-src/commit/7ae7df5b4601f3f0ce45a27324fb9c6ebcbfc9ed
  
 ===== References ===== ===== References =====
rfc/iterator_xyz_accept_array.1655824974.txt.gz · Last modified: 2022/06/21 15:22 by timwolla