php-src
php-src copied to clipboard
SplFileObject: key() returns wrong value
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
Also found this comment https://www.php.net/manual/de/splfileobject.fgets.php#126525