3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function __call($x, $y){ echo "wat"; } static function __callStatic($x, $y){ echo "wut"; } function m(){ $fn = ['A', 'test']; call_user_func($fn); $fn(); } } (new A())->m();
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
wat Fatal error: Uncaught Error: Non-static method A::test() cannot be called statically in /in/i3VmG:13 Stack trace: #0 /in/i3VmG(18): A->m() #1 {main} thrown in /in/i3VmG on line 13
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
wat Fatal error: Non-static method A::test() cannot be called statically in /in/i3VmG on line 13
Process exited with code 255.

preferences:
65.27 ms | 1525 KiB | 4 Q