3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { return 'bar'; } public static function foo() { return self::bar(); } } var_dump(Foo::foo());
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 Foo::bar() cannot be called statically in /in/Etqaa:7 Stack trace: #0 /in/Etqaa(11): Foo::foo() #1 {main} thrown in /in/Etqaa on line 7
Process exited with code 255.
Output for 5.3.23, 5.4.13
Fatal error: Constructor Foo::foo() cannot be static in /in/H2OoM on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.4.0 - 5.4.12
Fatal error: Constructor Foo::foo() cannot be static in Etqaa on line 9
Process exited with code 255.

preferences:
83.06 ms | 402 KiB | 65 Q