3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { function bar($a, $b): void; } class Baz implements Foo { function bar($c, $d): void { var_dump([$c, $d]); } } call_user_func_array([(new Baz), 'bar'], ['b' => 123, 'a' => 456]);
Output for 8.0.0 - 8.0.13, 8.1rc1 - rc3
Fatal error: Uncaught Error: Unknown named parameter $b in /in/Kor4l:13 Stack trace: #0 {main} thrown in /in/Kor4l on line 13
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.26
array(2) { [0]=> int(123) [1]=> int(456) }

preferences:
25.82 ms | 460 KiB | 5 Q