iterationStack ?? [], function($item) { return ! $item['or']; }); $count = count($stack); if ( $count > 0 ) { $name .= "[" . end($stack)['uid'] . "]"; } $context->iterationStack[] = [ 'or' => false, 'uid' => $name, 'token' => "end{$token}", ]; return ""; } protected function closeLoop(\Picea\Compiler\Context &$context, ?string $arguments, string $token,) : string { $last = end($context->iterationStack); if ( $last['or'] === false ) { $output = ""; } else { $output = ""; } array_pop($context->iterationStack); return $output; } }