3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function test($a, $b) { var_dump('A:' . $a); var_dump('B:' . $b); } } $a = new A; call_user_func_array([$a, 'test'], ['1', '2']); // this works call_user_func_array([$a, 'test'], ['b' => '2', 'a' => 1]); // this works too call_user_func_array([$a, 'test'], ['c' => 1, 'd' => 2]); // this deoesnt work since php8 since there are no parametes names c or d

preferences:
32.01 ms | 404 KiB | 5 Q