3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Similar to code in \Drupal\KernelTests\KernelTestBase::getModulesToEnable() $array = [ 'test' => ['foo'], 'test2' => ['bar'], ]; var_dump(call_user_func_array('array_merge_recursive', $array));
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
array(2) { [0]=> string(3) "foo" [1]=> string(3) "bar" }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.33, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Fatal error: Uncaught ArgumentCountError: array_merge_recursive() does not accept unknown named parameters in /in/YJbr3:8 Stack trace: #0 /in/YJbr3(8): array_merge_recursive(test: Array, test2: Array) #1 {main} thrown in /in/YJbr3 on line 8
Process exited with code 255.

preferences:
29.71 ms | 1139 KiB | 10 Q