- Added a loop index in AbstractLoop control struct.

This commit is contained in:
Dave Mc Nicoll 2025-10-03 18:34:32 +00:00
parent e737e82d7e
commit 633926b1db

View File

@ -27,7 +27,7 @@ abstract class AbstractLoop implements ControlStructure {
'token' => "end{$token}", 'token' => "end{$token}",
]; ];
return "<?php $token ($arguments): $name = ( $name ?? 0 ) + 1; ?>"; return "<?php $token ($arguments): \$__loop_index = $name = ( $name ?? 0 ) + 1; ?>";
case "endwhile": case "endwhile":
case "endforeach": case "endforeach":