3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $color = array('white', 'green', 'red'); $reversed = array_reverse($input); foreach ($reversed as $c) { echo "$c, "; }
based on b8E8X
Output for 5.3.0 - 7.1.0
Notice: Undefined variable: input in /in/3cfKq on line 3 Warning: array_reverse() expects parameter 1 to be array, null given in /in/3cfKq on line 3 Warning: Invalid argument supplied for foreach() in /in/3cfKq on line 4
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: input in /in/3cfKq on line 3 Warning: array_reverse(): The argument should be an array in /in/3cfKq on line 3 Warning: Invalid argument supplied for foreach() in /in/3cfKq on line 4
Output for 4.3.2 - 4.3.10, 4.4.0 - 5.0.3
Notice: Undefined variable: input in /in/3cfKq on line 3 Warning: array_reverse(): The argument should be an array in /in/3cfKq on line 3 Warning: Invalid argument supplied for foreach() in /in/3cfKq on line 4
Output for 4.3.11
Notice: Undefined variable: input in /in/3cfKq on line 3 Warning: array_reverse(): The argument should be an array in /in/3cfKq on line 3
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: input in /in/3cfKq on line 3 Warning: array_reverse() [http://www.php.net/function.array-reverse]: The argument should be an array in /in/3cfKq on line 3 Warning: Invalid argument supplied for foreach() in /in/3cfKq on line 4