3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 'A' => array(1, 2, 3, 4), 'B' => array(5, 6), 'C' => array('a', 'b', 'c')); $values=""; function makeCombinations($array,$values){ if(is_array($array)) { foreach($array as $value) { makeCombinations($value,$values); } } else { $values.=$array; } } makeCombinations($array); echo $values;
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function makeCombinations(), 1 passed in /in/R7mFb on line 18 and exactly 2 expected in /in/R7mFb:4 Stack trace: #0 /in/R7mFb(18): makeCombinations(Array) #1 {main} thrown in /in/R7mFb on line 4
Process exited with code 255.
Output for 5.1.0 - 7.0.14
Warning: Missing argument 2 for makeCombinations(), called in /in/R7mFb on line 18 and defined in /in/R7mFb on line 4 Notice: Undefined variable: values in /in/R7mFb on line 9 Notice: Undefined variable: values in /in/R7mFb on line 9 Notice: Undefined variable: values in /in/R7mFb on line 9
Output for 5.0.0 - 5.0.5
Warning: Missing argument 2 for makeCombinations() in /in/R7mFb on line 4
Output for 4.3.0 - 4.4.9
Warning: Missing argument 2 for makecombinations() in /in/R7mFb on line 4