rfc:any_all_on_iterable_straw_poll

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:any_all_on_iterable_straw_poll [2020/12/20 15:19] tandrerfc:any_all_on_iterable_straw_poll [2020/12/29 00:07] (current) tandre
Line 3: Line 3:
   * Date: 2020-12-19   * Date: 2020-12-19
   * Author: Tyson Andre, tandre@php.net   * Author: Tyson Andre, tandre@php.net
-  * Status: Voting+  * Status: Complete
   * First Published at: http://wiki.php.net/rfc/any_all_on_iterable_straw_poll   * First Published at: http://wiki.php.net/rfc/any_all_on_iterable_straw_poll
  
Line 50: Line 50:
 Voting starts on 2020-12-19 and will close on 2020-12-26. Voting starts on 2020-12-19 and will close on 2020-12-26.
  
-<doodle title="Straw poll: Preferred choice of naming pattern" auth="tandre" voteType="multi" closed="false">+<doodle title="Straw poll: Preferred choice of naming pattern" auth="tandre" voteType="multi" closed="true">
    * any() and all()    * any() and all()
    * iter_any() and iter_all()    * iter_any() and iter_all()
Line 95: Line 95:
  
   * I don't want to be in a situation where there are a large number of ''iterator_*()'' functions, where some accept ''Traversable'' and some accept ''iterable''.   * I don't want to be in a situation where there are a large number of ''iterator_*()'' functions, where some accept ''Traversable'' and some accept ''iterable''.
 +  * I also don't want to be in a situation where some have $iterator as a named argument (since PHP 8.0, e.g. ''iterator_to_array()'') and others have $iterable.
 +  * If I was choosing names from scratch, ''*foo(iterable $iterable, ...)'' would make more sense than ''iterator_foo(iterable $iterator, ...)''
  
 Changing other iterator functions such as ''iterator_apply()'', ''iterator_count()'', and ''iterator_to_array()'' to accept iterator instead of Traversable(Iterator and IteratorAggregate) is out of the scope of the RFC or straw poll. Changing other iterator functions such as ''iterator_apply()'', ''iterator_count()'', and ''iterator_to_array()'' to accept iterator instead of Traversable(Iterator and IteratorAggregate) is out of the scope of the RFC or straw poll.
  
  
-  * My preference would be to add new ''iterable_apply()'', ''iterable_count()'', and ''iterable_to_array()'' functions instead of modifying the existing methods. This would be possible to polyfill, and it would be less likely that code developed for 8.1+ would pass arrays that would be rejected by php 8.0 and older. +  * My preference would be to add new ''iterable_apply()'', ''iterable_count()'', and ''iterable_to_array()'' functions instead of modifying the existing methods. This would be possible to polyfill, and it would be less likely that code developed for 8.1+ would pass arrays that would be rejected by php 8.0 and older.  
 +  * Any alternative RFCs to change the behaviors of ''iterator_apply()'', ''iterator_count()'', and ''iterator_to_array()'' can be done independently of adding ''*any()'' and ''*all()''.
  
 ===== References ===== ===== References =====
rfc/any_all_on_iterable_straw_poll.1608477563.txt.gz · Last modified: 2020/12/20 15:19 by tandre