3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $q = range(100); $result = array(); foreach($q as $key => $value) { if (0 === $value % 2) { $result = $key; } } var_dump($result);
based on dZ35t
Output for 5.0.0 - 7.1.0
Warning: range() expects at least 2 parameters, 1 given in /in/X2hcK on line 3 Warning: Invalid argument supplied for foreach() in /in/X2hcK on line 6 array(0) { }
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9
Warning: Wrong parameter count for range() in /in/X2hcK on line 3 Warning: Invalid argument supplied for foreach() in /in/X2hcK on line 6 array(0) { }
Output for 4.3.11
Warning: Wrong parameter count for range() in /in/X2hcK on line 3 array(0) { }