Skip to content

SplFileObject: key() returns wrong value #8273

@gabrielpl

Description

@gabrielpl

Description

The following code: https://3v4l.org/RHFfI#v8.1.4

Resulted in this output:

0: line 0
0: line 1
1: line 2
2: line 3
3: line 4

But I expected this output instead:

0: line 0
1: line 1
2: line 2
3: line 3
4: line 4

PHP Version

PHP 8.1.4

Operating System

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions