3v4l.org

run code in 300+ PHP versions simultaneously
<?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; }
Output for 5.6.38, 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Parse error: syntax error, unexpected '$list' (T_VARIABLE) in /in/f8sWj on line 8
Process exited with code 255.

preferences:
174.41 ms | 1395 KiB | 44 Q