3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { static function test() { call_user_func_array(array('self', 'reply'), array('derp')); } function reply($derp) { echo $derp; } } echo Test::test();
Output for 8.2.10 - 8.2.18, 8.3.0 - 8.3.7
Deprecated: Use of "self" in callables is deprecated in /in/Bk0cs on line 4 Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method Test::reply() cannot be called statically in /in/Bk0cs:4 Stack trace: #0 /in/Bk0cs(12): Test::test() #1 {main} thrown in /in/Bk0cs on line 4
Process exited with code 255.
Output for 8.1.23 - 8.1.28
Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method Test::reply() cannot be called statically in /in/Bk0cs:4 Stack trace: #0 /in/Bk0cs(12): Test::test() #1 {main} thrown in /in/Bk0cs on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.16, 5.4.0 - 5.4.6
Fatal error: Constructor Test::test() cannot be static in /in/Bk0cs on line 10
Process exited with code 255.

preferences:
73.82 ms | 402 KiB | 52 Q