3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private static function method() { echo "OK"; } public static function test() { call_user_func(array('self', 'method')); } } Test::test();
Output for 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Use of "self" in callables is deprecated in /in/E7n49 on line 8 OK
Output for 8.1.23 - 8.1.28
OK
Output for 5.3.0 - 5.3.24, 5.4.0 - 5.4.14
Fatal error: Constructor Test::test() cannot be static in /in/E7n49 on line 10
Process exited with code 255.

preferences:
81.5 ms | 402 KiB | 67 Q