3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Foo { private function foo() { echo __METHOD__; } } class Bar extends Foo { public static function bar() { $bar = new Bar(); $bar->foo(); } } class Baz { public static function baz() { echo __METHOD__; } } Baz::baz();
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Baz::baz
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 Baz::baz
Output for 7.0.0 - 7.0.2
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/Nuekf on line 3 Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Bar has a deprecated constructor in /in/Nuekf on line 9 Fatal error: Constructor Bar::bar() cannot be static in /in/Nuekf on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17
Fatal error: Constructor Bar::bar() cannot be static in /in/Nuekf on line 14
Process exited with code 255.

preferences:
76.31 ms | 402 KiB | 48 Q