3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 2, 3]; $b = null; var_dump(array_merge($a, $b));
Output for 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.17, 8.5.0 - 8.5.2
Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /in/N3hms:6 Stack trace: #0 /in/N3hms(6): array_merge(Array, NULL) #1 {main} thrown in /in/N3hms on line 6
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: array_merge(): Expected parameter 2 to be an array, null given in /in/N3hms on line 6 NULL
Output for 7.1.26 - 7.1.33, 7.2.17 - 7.2.33
Warning: array_merge(): Argument #2 is not an array in /in/N3hms on line 6 NULL

preferences:
202.27 ms | 408 KiB | 5 Q