3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Foo: int { const BAR = "F"; case F = Foo::BAR; private function foo() {} } var_dump(Foo::F);
Output for 8.1.0 - 8.1.13
Fatal error: Enum case type string does not match enum backing type int in /in/bgraf on line 6
Process exited with code 255.
Output for 8.0.1 - 8.0.26
Parse error: syntax error, unexpected identifier "Foo" in /in/bgraf on line 3
Process exited with code 255.

preferences:
181.19 ms | 1395 KiB | 46 Q