3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(array ...$things) {var_dump($things);} foo([]); foo('ciao', 'a', 'tutti');
Output for 7.0.28 - 7.3.0rc3
array(1) { [0]=> array(0) { } } Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, string given, called in /in/vfT0U on line 6 and defined in /in/vfT0U:3 Stack trace: #0 /in/vfT0U(6): foo('ciao', 'a', 'tutti') #1 {main} Next TypeError: Argument 2 passed to foo() must be of the type array, string given, called in /in/vfT0U on line 6 and defined in /in/vfT0U:3 Stack trace: #0 /in/vfT0U(6): foo('ciao', 'a', 'tutti') #1 {main} Next TypeError: Argument 3 passed to foo() must be of the type array, string given, called in /in/vfT0U on line 6 and defined in /in/vfT0U:3 Stack trace: #0 /in/vfT0U(6): foo('ciao', 'a', 'tutti') #1 {main} thrown in /in/vfT0U on line 3
Process exited with code 255.
Output for 5.6.38
array(1) { [0]=> array(0) { } } Catchable fatal error: Argument 1 passed to foo() must be of the type array, string given, called in /in/vfT0U on line 6 and defined in /in/vfT0U on line 3
Process exited with code 255.