Hi

On 07.04.24 16:35, Larry Garfield wrote:
1. Should this work on arrays or iterables?  This is a long standing limitation 
of PHP.  The array operations don't work on iterables, even though we've had 
iterables for 20 years.)

In the longer term, it definitely makes sense to create a separate API here that can handle not only arrays, but iterables in general. I have heard this suggestion in various places (including in the mailing list) and had also looked into it in the process of this RFC, but did not pursue it further after the initial idea, as it would be important for me that such an API is planned accordingly and has an appropriate repertoire right from the start (functions such as map, filter, find, push, pop, …). In my opinion, a single function would be very out of place, especially if this API is then really soon tackled and then possibly differs from the implementation of the RFC.

2. Key handling.  It's good that you have looked into this, because I was going 
to mention it. :-)  However, I don't think a boolean is the right answer, since 
the question is binary, not true/false.  (Those are not the same thing.)  I 
think a small return-mode Enum would make more sense here.

I like the idea, thank you! However, I am unsure whether an additional enum for the function would not be too much overhead.

Cheers

Joshua Rüsweg

Reply via email to