php-src icon indicating copy to clipboard operation
php-src copied to clipboard

SplFileObject: key() returns wrong value

Open gabrielpl opened this issue 4 years ago • 1 comments

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

gabrielpl avatar Mar 29 '22 19:03 gabrielpl

Also found this comment https://www.php.net/manual/de/splfileobject.fgets.php#126525

Tobion avatar Apr 06 '22 23:04 Tobion