[ 'code' => ' [ 'code' => ' [ 'code' => ' [ '$a' => 'bool', ], ], 'forLoopwithOKChange' => [ 'code' => ' [ 'code' => ' $v */ $v = [1 => 0]; for ($d = 0; $d <= 10; $d++) { for ($k = -$d; $k <= $d; $k += 2) { if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { $x = $v[$k+1]; } else { $x = $v[$k-1] + 1; } $v[$k] = $x; } } }', ], 'whileTrueWithBreak' => [ 'code' => ' [ '$a' => 'string', '$b' => 'int', ], ], 'continueOutsideLoop' => [ 'code' => 'next; $node->next = null; } }', ], 'echoAfterFor' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' $arr */ function cartesianProduct(array $arr) : void { for ($i = 20; $arr[$i] === 5 && $i > 0; $i--) {} }' ], 'noCrashOnLongThing' => [ 'code' => ' $data */ function makeData(array $data) : array { while (rand(0, 1)) { while (rand(0, 1)) { while (rand(0, 1)) { if (rand(0, 1)) { continue; } /** @psalm-suppress PossiblyUndefinedArrayOffset */ $data[0]["a"] = array_merge($data[0]["a"], $data[0]["a"]); } } } return $data; }' ], 'InfiniteForLoop' => [ 'code' => ' [ 'code' => ' 'PossiblyUndefinedGlobalVariable - src' . DIRECTORY_SEPARATOR . 'somefile.php:4:29 - Possibly undefined ' . 'global variable $array, first seen on line 4', ], 'forLoopInvalidation' => [ 'code' => ' 'LoopInvalidation', ], 'forInfiniteNoBreak' => [ 'code' => ' 'UndefinedGlobalVariable', ], 'nestedEchoAfterFor' => [ 'code' => ' 'PossiblyUndefinedGlobalVariable', ], ]; } }