src/View/Blade.php
public function compileWhile($expression)
    {
        $expression = $this->normalizeExpression($expression);
        
        preg_match('/ *(.*?) *(?:, *(.*))? *$/is', $expression, $matches);
        
        $iteration = isset($matches[2]) ? trim($matches[1]) : $expression;
        $length = isset($matches[2]) ? trim($matches[2]) : '';
        
        $initLoop = '$loop = new ' . Counter::class . "(); \$__currentLoopData = \$loop->start({$length}); \$__loops->addLoop(\$__currentLoopData);";
        
        return "<?php {$initLoop} while({$iteration}): ?>";
    }
public function compileWhile($expression)
    {
        $expression = $this->normalizeExpression($expression);
        
        preg_match('/ *(.*?) *(?:, *(.*))? *$/is', $expression, $matches);
        
        $iteration = isset($matches[2]) ? trim($matches[1]) : $expression;
        $length = isset($matches[2]) ? trim($matches[2]) : '';
        
        $initLoop = '$loop = new ' . Counter::class . "(); \$__currentLoopData = \$loop->start({$length}); \$__loops->addLoop(\$__currentLoopData);";
        
        return "<?php {$initLoop} while({$iteration}): ?>";
    }
public function compileWhile ( $ expression ) { $ expression = $ this -> normalizeExpression ( $ expression ) ; preg_match ( '/ *(.*?) *(?:, *(.*))? *$/is' , $ expression , $ matches ) ; $ iteration = isset ( $ matches [ 2 ] ) ? trim ( $ matches [ 1 ] ) : $ expression ; $ length = isset ( $ matches [ 2 ] ) ? trim ( $ matches [ 2 ] ) : '' ; $ initLoop = '$loop = new ' . Counter :: class . "(); \$__currentLoopData = \$loop->start({$length}); \$__loops->addLoop(\$__currentLoopData);" ; return "<?php {$initLoop} while({$iteration}): ?>" ; }
Compile the while statements into valid PHP.

@param  string  $expression
@return string
Compile the while statements into valid PHP .