Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplFileObject: key() returns wrong value #8273

Closed
gabrielpl opened this issue Mar 29, 2022 · 1 comment
Closed

SplFileObject: key() returns wrong value #8273

gabrielpl opened this issue Mar 29, 2022 · 1 comment

Comments

@gabrielpl
Copy link

gabrielpl commented Mar 29, 2022

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

@Tobion
Copy link
Contributor

Tobion commented Apr 6, 2022

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

Girgias added a commit to Girgias/php-src that referenced this issue Apr 7, 2022
Girgias added a commit that referenced this issue Apr 23, 2022
* PHP-8.1:
  Fix GH-8273: SplFileObject: key() returns wrong value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@Tobion @cmb69 @gabrielpl and others