- 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.
<?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;
}