3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function add($a, $b, $c) { return $a + $b + $c; } $operators = 2; echo add(1, ...$operators);
based on CQa3c
Output for 7.1.0 - 7.2.0
Warning: Only arrays and Traversables can be unpacked in /in/VUbhp on line 8 Fatal error: Uncaught ArgumentCountError: Too few arguments to function add(), 1 passed in /in/VUbhp on line 8 and exactly 3 expected in /in/VUbhp:3 Stack trace: #0 /in/VUbhp(8): add(1) #1 {main} thrown in /in/VUbhp on line 3
Process exited with code 255.
Output for 5.6.7 - 7.0.20
Warning: Only arrays and Traversables can be unpacked in /in/VUbhp on line 8 Warning: Missing argument 2 for add(), called in /in/VUbhp on line 8 and defined in /in/VUbhp on line 3 Warning: Missing argument 3 for add(), called in /in/VUbhp on line 8 and defined in /in/VUbhp on line 3 Notice: Undefined variable: b in /in/VUbhp on line 4 Notice: Undefined variable: c in /in/VUbhp on line 4 1
Output for 5.3.19 - 5.5.35
Parse error: syntax error, unexpected '.' in /in/VUbhp on line 8
Process exited with code 255.