[ticket/11701] Fix loops var check

PHPBB3-11701