rfc:cachediterable_straw_poll

This is an old revision of the document!


PHP RFC: Straw poll: Namespace to use for CachedIterable and iterable functionality

Introduction

CachedIterable and successors to the any() and all() on iterables proposed adding additional iterable functionality to php. E.g. CachedIterable eagerly evaluates any iterable and contains an immutable copy of the keys and values of the iterable it was constructed from.

After that was created, https://wiki.php.net/rfc/namespaces_in_bundled_extensions passed.

However, as there have not been any RFCs started that propose adding functionality using namespaces other than the global namespace in existing extensions yet, I'm uncertain as to how voters will interpret the “namespaces in bundled extensions” RFC at voting time.

In particular, https://wiki.php.net/rfc/namespaces_in_bundled_extensions#core_standard_spl and https://wiki.php.net/rfc/namespaces_in_bundled_extensions#existing_non-namespaces_symbols_and_consistency can be interpreted in different ways - the RFC recommends the usage of namespaces for functionality in core, but permits functionality to use the global namespace if it would be consistent with similar non-namespaced functionality already in core/standard/spl.

In addition to that, because this says “may” and “should” instead of “must”, there

Proposal

Create a straw poll for the functionality from CachedIterable and successors to the any() and all() on iterables RFC: any()/all()/none()/find()/reduce()

Proposed Voting Choices

Note that due to a limitation of the wiki software, forms must be voted on separately. If you are opposed to this functionality being added to PHP in any form, please note this in addition to your preferred namespacing choice, given that https://wiki.php.net/rfc/namespaces_in_bundled_extensions has passed.

https://wiki.php.net/rfc/namespaces_in_bundled_extensions strongly discourages some of the previously considered options

Extensions should not use a vendor namespace.

...

Namespace names should follow CamelCase.

...

Because these extensions combine a lot of unrelated or only tangentially related functionality, symbols should not be namespaced under the Core, Standard or Spl namespaces. Instead, these extensions should be considered as a collection of different components, and should be namespaced according to these.

Preferred namespacing choice for CachedIterable

Preferred namespacing choice for CachedIterable
Real name Iterable\CachedIterable CachedIterable Collections\CachedIterable Other namespacing choice Opposed to adding this functionality to php
alec (alec)     
ashnazg (ashnazg)     
bmajdak (bmajdak)    
crell (crell)    
derick (derick)   
galvao (galvao)     
kalle (kalle)     
kguest (kguest)     
levim (levim)     
mcmic (mcmic)     
mgocobachi (mgocobachi)     
nicolasgrekas (nicolasgrekas)     
ocramius (ocramius)   
pollita (pollita)     
ramsey (ramsey)     
reywob (reywob)    
tandre (tandre)    
Final result: 8 10 2 2 3
This poll has been closed.


Preferred namespacing choice for successors to the any() and all() on iterables RFC: any()/all()/none()/find()/reduce()

Preferred namespacing choice for any()/all()/none()/reduce()/find()
Real name Iterable\any() iterable_any() Other namespacing choice Opposed to adding this functionality to php
ashnazg (ashnazg)    
bmajdak (bmajdak)   
crell (crell)   
derick (derick)  
galvao (galvao)    
kalle (kalle)   
kguest (kguest)    
levim (levim)    
mcmic (mcmic)    
mgocobachi (mgocobachi)    
nicolasgrekas (nicolasgrekas)    
ocramius (ocramius)    
pollita (pollita)    
ramsey (ramsey)    
reywob (reywob)    
tandre (tandre)   
Final result: 10 7 3 2
This poll has been closed.


Functionality of interest in the successor to the any() and all() on iterables RFC: any()/all()/none()/find()/reduce()

(functionality such as reversed(), flip(iterable): CachedIterable, etc. that would require CachedIterable is left out of this question)

(in this proposal, find() and reduce() act only on values of iterables. Passing too many arguments is currently an error for internal functions and it is possible that it would be deprecated for user-defined functions in the future.)

Global functions I would want to add to PHP to act on iterables as described
Real name any(...)/all(iterable $input, $callback = null): bool none(...): bool find(iterable $input, $callback, $default = null): mixed reduce(iterable $input, $callback, $initial = null): mixed Still too small in scope
Final result: 0 0 0 0 0
This poll has been closed.
rfc/cachediterable_straw_poll.1622595795.txt.gz · Last modified: 2021/06/02 01:03 by tandre