Method equal()


Method equal

bool equal(mixed a, mixed b)

Description

This function checks if the values a and b are equivalent.

Returns

If either of the values is an object the (normalized) result of calling lfun::_equal() will be returned.

Returns 1 if both values are false (zero, destructed objects, prototype functions, etc).

Returns 0 (zero) if the values have different types.

Otherwise depending on the type of the values:

int

Returns the same as a == b.

float
string
program
array

The contents of a and b are checked recursively, and if all their contents are equal and in the same place and have the same set_weak_flag() flags, they are considered equal.

Note that for objects this case is only reached if neither a nor b implements lfun::_equal().

mapping
multiset
object
function(:void)

Two functions are equal if they refer to the same identifier in the same class and their objects are equal.

type

Returns (a <= b) && (b <= a).

See also

copy_value(), get_weak_flag(), set_weak_flag(), `==()