Re: RFC [Discussion]: array_find

From: Date: Wed, 01 May 2024 20:38:02 +0000
Subject: Re: RFC [Discussion]: array_find
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-123248@lists.php.net to get a copy of this message
Hi On 19.04.24 23:29, Tim Düsterhus wrote:> Thinking about this: I believe that it would make sense to bundle
array_any and array_every (or array_all, see below) within the same RFC due to the similarity. It can be a separate vote for those two, but having the option of getting all three would probably alleviate my concerns of adding new array functions piecemeal. The implementation should be trivial, because it effectively just changes the return type. Nevertheless I'm happy to assist should any issues arise. As for the naming:
JavaScript: every      + some
Haskell   : all        + any
Rust      : all        + any
C++       : all_of     + any_of + none_of
Java      : allMatch   + anyMatch (in java.util.stream.Stream)
Swift     : allSatisfy + contains(where: …)
It appears the commonly used choice is all + any.
Thanks for your suggestion! I have added the array_any and array_all functions to the RFC accordingly. Cheers Josh

« previous php.internals (#123248) next »