3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function itemsasd(){ $args = array(); echo "Number of arguments: " . func_num_args() . "<br />"; for($i = 0 ; $i < func_num_args(); $i++) { echo "Argument $i = " . func_get_arg($i) . "<br />"; $args[i] = func_get_arg($i); } foreach($args as $arg){ echo $arg; } } itemsasd(1,2,3) ?>
Output for 7.2.0
Number of arguments: 3<br />Argument 0 = 1<br /> Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/N0OXo on line 9 Argument 1 = 2<br /> Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/N0OXo on line 9 Argument 2 = 3<br /> Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/N0OXo on line 9 3
Output for 4.3.0 - 7.1.10
Number of arguments: 3<br />Argument 0 = 1<br /> Notice: Use of undefined constant i - assumed 'i' in /in/N0OXo on line 9 Argument 1 = 2<br /> Notice: Use of undefined constant i - assumed 'i' in /in/N0OXo on line 9 Argument 2 = 3<br /> Notice: Use of undefined constant i - assumed 'i' in /in/N0OXo on line 9 3