Comparisons\isNotEqualTo()

predicate returns Closure returns bool pure
T → (mixed → bool)
At a glance — Inverse of isEqualTo. Bind a value; the returned Closure returns true for anything that isn't it (loosely).

Creates a predicate Closure that is true when the passed value is loosely NOT equal (!=) to the bound value.

/**
  * @param mixed $a
  * @return Closure(mixed):bool
  */
Comparisons\isNotEqualTo($a): Closure

Returned Closure

When Comparisons\isNotEqualTo() is called, it returns the following Closure which can be used like a regular function.

/**
  * @param mixed $b
  * @return bool
  */
$function ($b): bool

Examples

Partial Application

This can be used to create a simple closure which can be used as a regular function.

$notFoo = Comparisons\isNotEqualTo('foo');

$withoutFoo = array_filter(['foo', 'bar', 'foo', 'baz'], $notFoo);
print_r($withoutFoo); // ['bar', 'baz']

Details

Comparisons Functions

Releated Equality Functions