3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public function x(){ return true; } public function y(){ return self::x(); } } var_dump(T::x()); class X { public function x(){ return true; } public function y(){ return self::x(); } } var_dump(X:x());
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Non-static method T::x() cannot be called statically in /in/JVE9W:12 Stack trace: #0 {main} thrown in /in/JVE9W on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.20
Parse error: syntax error, unexpected ':' in /in/JVE9W on line 24
Process exited with code 255.

preferences:
89.17 ms | 402 KiB | 76 Q