HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/spilicensing/vendor/nikic/php-parser/test/code/parser/stmt/loop/for.test
For loop
-----
<?php

// "classical" loop
for ($i = 0; $i < $c; ++$i) {}

// multiple expressions
for ($a, $b; $c, $d; $e, $f) {}

// infinite loop
for (;;) {}

// alternative syntax
for (;;):
endfor;
-----
array(
    0: Stmt_For(
        init: array(
            0: Expr_Assign(
                var: Expr_Variable(
                    name: i
                )
                expr: Scalar_LNumber(
                    value: 0
                )
            )
        )
        cond: array(
            0: Expr_BinaryOp_Smaller(
                left: Expr_Variable(
                    name: i
                )
                right: Expr_Variable(
                    name: c
                )
            )
        )
        loop: array(
            0: Expr_PreInc(
                var: Expr_Variable(
                    name: i
                )
            )
        )
        stmts: array(
        )
    )
    1: Stmt_For(
        init: array(
            0: Expr_Variable(
                name: a
            )
            1: Expr_Variable(
                name: b
            )
        )
        cond: array(
            0: Expr_Variable(
                name: c
            )
            1: Expr_Variable(
                name: d
            )
        )
        loop: array(
            0: Expr_Variable(
                name: e
            )
            1: Expr_Variable(
                name: f
            )
        )
        stmts: array(
        )
    )
    2: Stmt_For(
        init: array(
        )
        cond: array(
        )
        loop: array(
        )
        stmts: array(
        )
    )
    3: Stmt_For(
        init: array(
        )
        cond: array(
        )
        loop: array(
        )
        stmts: array(
        )
    )
)