==. Use isScalar or type predicates if you need strict equality plus type-matching.
Creates a predicate Closure that is true when the passed value is loosely equal (==) to the bound value.
/**
* @param mixed $a
* @return Closure(mixed):bool
*/
Comparisons\isEqualTo($a): ClosureWhen Comparisons\isEqualTo() is called, it returns the following Closure which can be used like a regular function.
/**
* @param mixed $b
* @return bool
*/
$function ($b): boolThis can be used to create a simple closure which can be used as a regular function.
$isFoo = Comparisons\isEqualTo('foo');
var_dump($isFoo('foo')); // true
var_dump($isFoo('bar')); // false
$foos = array_filter(['foo', 'bar', 'foo', 'baz'], $isFoo);
count($foos); // 2This can be called inline using currying.
var_dump(Comparisons\isEqualTo(1)('1')); // true (loose ==)