On Mon, Feb 11, 2019 at 9:59 AM Levi Morrison <le...@php.net> wrote:
> My position is the same: pushing the variadic behavior into the
> functions means that each function needs to pick `||` or `&&`
> behavior, both of which are useful.
>
Additionally, I recall from that thread (or a similar one on the same
topic) some pushback on isset() even having behavior like this.  That it
should be considered a mistake.  Not saying I agree with going so far as to
call it a mistake, but it does seem to have been an less than ideal choice.

> I would rather see more
> descriptive function names, such as `all_of` or `any_of`:
>
The feels like your C++ experience talking. :D
I do agree though, I think this model gives much more power and
flexibility, I'd also favor such functions taking iterables (as you show in
your examples) over variadic signatures (as shown in some replies) because
this allows the short-circuiting to halt generators early as well.

> These do not need to be part of PHP core, but perhaps they could be.
>
My preference is for the community to build what they want in userspace,
then worry about teaching the engine to optimize the pattern when it sees
it.

-Sara

Reply via email to