3v4l.org

run code in 300+ PHP versions simultaneously
<?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
Output for git.master_jit, git.master
bool(false) bool(false) bool(false) bool(false) bool(true) bool(false) bool(true) bool(false) bool(false) bool(true)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
34.74 ms | 477 KiB | 5 Q