src/PhpToZephir/Converter/Printer/Stmt/ForPrinter.php
private function findIteratorVar(Stmt\For_ $node)
    {
        $varName = $node->init[0]->var;
        $varValue = $node->init[0]->expr;

        if ($node->cond[0]->left instanceof Variable && $node->cond[0]->left->name === $varName->name) {
            $node->cond[0]->left = $varValue;
        } elseif ($node->cond[0]->right instanceof Variable && $node->cond[0]->right->name === $varName->name) {
            $node->cond[0]->right = $varValue;
        }
        
        if ($node->cond[0] instanceof BinaryOp\Smaller && $node->cond[0]->right instanceof Scalar\LNumber) {
            --$node->cond[0]->right->value;
        }

        return $node;
    }
private function findIteratorVar(Stmt\For_ $node)
    {
        $varName = $node->init[0]->var;
        $varValue = $node->init[0]->expr;

        if ($node->cond[0]->left instanceof Variable && $node->cond[0]->left->name === $varName->name) {
            $node->cond[0]->left = $varValue;
        } elseif ($node->cond[0]->right instanceof Variable && $node->cond[0]->right->name === $varName->name) {
            $node->cond[0]->right = $varValue;
        }
        
        if ($node->cond[0] instanceof BinaryOp\Smaller && $node->cond[0]->right instanceof Scalar\LNumber) {
            --$node->cond[0]->right->value;
        }

        return $node;
    }
private function findIteratorVar ( Stmt \ For_ $ node ) { $ varName = $ node -> init [ 0 ] -> var ; $ varValue = $ node -> init [ 0 ] -> expr ; if ( $ node -> cond [ 0 ] -> left instanceof Variable && $ node -> cond [ 0 ] -> left -> name === $ varName -> name ) { $ node -> cond [ 0 ] -> left = $ varValue ; } elseif ( $ node -> cond [ 0 ] -> right instanceof Variable && $ node -> cond [ 0 ] -> right -> name === $ varName -> name ) { $ node -> cond [ 0 ] -> right = $ varValue ; } if ( $ node -> cond [ 0 ] instanceof BinaryOp \ Smaller && $ node -> cond [ 0 ] -> right instanceof Scalar \ LNumber ) { -- $ node -> cond [ 0 ] -> right -> value ; } return $ node ; }
@param Stmt\For_ $node

@return \Stmt\For_
@param Stmt \ For_ $node