Skip to content

for loop in a for loop does not break on time #16169

@remco-pc

Description

@remco-pc

Description

The following code:

<?php
for($i =0; $i < 10; $i++){
    echo $i . PHP_EOL;
    for(; $i < 12; $i++){
        echo $i . PHP_EOL;
    }
}

Resulted in this output:

0
0
1
2
3
4
5
6
7
8
9
10
11

But I expected this output instead:

0
0
1
2
3
4
5
6
7
8
9

PHP Version

8.3.11

Operating System

Debian 12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions