3v4l.org

run code in 300+ PHP versions simultaneously
<?php function lol($a, $b, $c){ $args = array_splice(func_get_args(), 0); var_dump(...$args); } function baz($a, $b, $c){ $args = [1,2,3]; lol(...$args); } baz();
Output for 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.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught ArgumentCountError: Too few arguments to function baz(), 0 passed in /in/iI06v on line 13 and exactly 3 expected in /in/iI06v:8 Stack trace: #0 /in/iI06v(13): baz() #1 {main} thrown in /in/iI06v on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for baz(), called in /in/iI06v on line 13 and defined in /in/iI06v on line 8 Warning: Missing argument 2 for baz(), called in /in/iI06v on line 13 and defined in /in/iI06v on line 8 Warning: Missing argument 3 for baz(), called in /in/iI06v on line 13 and defined in /in/iI06v on line 8 Notice: Only variables should be passed by reference in /in/iI06v on line 4 int(1) int(2) int(3)
Output for 5.6.8 - 5.6.28
Warning: Missing argument 1 for baz(), called in /in/iI06v on line 13 and defined in /in/iI06v on line 8 Warning: Missing argument 2 for baz(), called in /in/iI06v on line 13 and defined in /in/iI06v on line 8 Warning: Missing argument 3 for baz(), called in /in/iI06v on line 13 and defined in /in/iI06v on line 8 Strict Standards: Only variables should be passed by reference in /in/iI06v on line 4 int(1) int(2) int(3)
Output for 5.5.24 - 5.5.35
Parse error: syntax error, unexpected '.' in /in/iI06v on line 5
Process exited with code 255.

preferences:
144.11 ms | 401 KiB | 185 Q