Re: [RFC] Global functions any() and all() on iterables

From: Date: Tue, 01 Sep 2020 20:41:06 +0000
Subject: Re: [RFC] Global functions any() and all() on iterables
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-111767@lists.php.net to get a copy of this message
On 01-09-2020 09:30, Nikita Popov wrote: > To be in line with naming conventions, I would suggest calling these > iter_any() and iter_all(), using iter_* as the prefix for our future > additions to the "functions that work on arbitrary iterables" space. > iterable_any() and iterable_all() would work as well, though are > unnecessarily verbose. It would make a lot of sense if we end up having a set of array_* functions and a set of iter_* functions. It would be nice for the RFC to mention this as a possible future result. However I am equally tempted to reason otherwise: Since the new functions are generalizations of functions which only work for arrays, strip the array_ prefixes off the existing array functions to create a set of generalized counterparts. It does yield nice short function names. :) Also, it would not surprise me if the generalized functions gradually replace the good old array functions in the future. When that happens, I would rather not have the iter_ prefixes. Regards, Dik Takken

« previous php.internals (#111767) next »