- Output for 8.1.5
- bool(false) bool(false) bool(false) bool(false) bool(true) bool(false) bool(true) bool(false) bool(false) bool(true)
<?php declare(strict_types = 1);
enum Foo: int
{
case A = 1;
case B = 2;
}
var_dump(Foo::A > Foo::B); // I expect an error here as it is always false (enum cases are not comparable and always return false)
var_dump(Foo::A < Foo::B); // I expect an error here as it is always false (enum cases are not comparable and always return false)
var_dump(Foo::A === Foo::B); // OK
var_dump(Foo::A == Foo::B); // I expect an error here as it is always false (enum cases are not comparable and always return false)
var_dump(Foo::A === Foo::A); // I expect an error here as it is always true
var_dump(Foo::A->value > Foo::B->value); // OK
var_dump(Foo::A->value < Foo::B->value); // OK
var_dump(Foo::A->value === Foo::B->value); // OK
var_dump(Foo::A->value == Foo::B->value); // I'd probably expect an error here as well as always false
var_dump(Foo::A->value === Foo::A->value); // I'd probably expect an error here as well as this is always true