3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const FOO = 'hi'; public static function foo() { echo SELF::FOO; } } Foo::foo();
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
hi
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 hi
Output for 7.0.0 - 7.0.1
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/teHWj on line 3 Fatal error: Constructor Foo::foo() cannot be static in /in/teHWj on line 3
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Fatal error: Constructor Foo::foo() cannot be static in /in/teHWj on line 11
Process exited with code 255.

preferences:
84.21 ms | 402 KiB | 45 Q