3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $nums = array(7, 13, 2, 8, 54, 1); print "<p>" . find($nums) . "</p>"; function find($array) { if(!is_array($array)) return FALSE; $val = $array[0]; foreach($array as $nums) { if($nums > $val) { $val = $num; } } return $val; } ?>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 <p></p>
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 Notice: Undefined variable: num in /in/77DWv on line 18 <p></p>