in_array().
Creates a predicate Closure that is true when the passed value is loosely equal to any element of a bound set.
/**
* @param mixed[] $a
* @return Closure(mixed):?bool
*/
Comparisons\isEqualIn(array $a): ClosureWhen Comparisons\isEqualIn() is called, it returns the following Closure which can be used like a regular function.
/**
* @param mixed $b
* @return bool|null
*/
$function ($b)This can be used to create a simple closure which can be used as a regular function.
$isColour = Comparisons\isEqualIn(['red', 'green', 'blue']);
var_dump($isColour('red')); // true
var_dump($isColour('yellow')); // false
$colours = array_filter(['red', 'yellow', 'blue', 'pink'], $isColour);
print_r($colours); // ['red', 'blue']