Re: [PHP-DEV] RFC [Discussion]: array_find

Hi, Joshua!

Have you considered renaming $callback parameter to $predicate? I always considered “callback” to be a very generic word. Predicate, on the contrary, implies accepting a value and returning a bool.

···

Valentin Udaltsov

Hi

On 5/25/24 01:19, Valentin Udaltsov wrote:

Have you considered renaming `$callback` parameter to `$predicate`? I
always considered "callback" to be a very generic word. Predicate, on the
contrary, implies accepting a value and returning a bool.

For an entirely new API I would agree. But for the array_* functions we already have $callback for array_filter (and also array_map and array_reduce, but those are not predicate callbacks).

Also given the vote started with the $callback name and the fact that parameter names are part of the API (due to named parameters), it's probably to late to change it.

Best regards
Tim Düsterhus