1.5.0
#4 #39 #40: new equals()
method to compare enums
$enum = MyEnum::FOO();
if ($enum->equals(MyEnum::BAR())) {
...
}
It behaves the same as ==
:
if ($enum == MyEnum::BAR()) {
...
}
It was added because it carries a bit more sense than ==
which, because it is a loose comparison, is often source of confusion (comparing objects with ==
is often a no-go for good reasons).