3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $min = 2; $max = 5; $testValue $list = range($min, $max); $listLength = count($list); foreach (range(-1000000, -1000000 + 10) as $testValue) { $key = ($testValue + $min) % $listLength; if ($key < 0) { $key = $listLength + ($key % $listLength); } echo $list[$key]; echo PHP_EOL; }
based on S6ZId
Output for 5.6.38 - 7.3.0rc3
Parse error: syntax error, unexpected '$list' (T_VARIABLE) in /in/f8sWj on line 8
Process exited with code 255.