AbstractEnum::equals( string|self $other ): bool

In this article

Checks if this enum has the same value as the given value.

Parameters

$otherstring|selfrequired
The value or enum to compare.

Return

bool True if values are equal.

Source

final public function equals($other): bool
{
    if ($other instanceof self) {
        return $this->is($other);
    }
    return $this->value === $other;
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.