3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Something { const PARENT = 'parent'; } enum MyEnum:string { case firstChild = Something::PARENT . '_child1'; case secondChild = Something::PARENT . '_child2'; }
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.14, 8.4.16 - 8.4.18, 8.5.0 - 8.5.3
Output for 8.4.15
/bin/php-8.4.15: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for 8.0.1 - 8.0.28
Parse error: syntax error, unexpected identifier "MyEnum" in /in/5A41I on line 7
Process exited with code 255.

preferences:
31.9 ms | 947 KiB | 4 Q