diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-18 13:41:21 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-30 16:03:37 +0100 |
commit | f1d11c118dfdc911f2f33babb9b2cba8bf5acb67 (patch) | |
tree | 4959b0868ca862b6c31ea99a9541808ba55dba93 /UPGRADING | |
parent | 841b00f641d448f037c69f0910ec4fb54cd64b20 (diff) | |
download | php-git-f1d11c118dfdc911f2f33babb9b2cba8bf5acb67.tar.gz |
Fix #62004: SplFileObject: fgets after seek returns wrong line
As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file pointer to the
beginning of the following line, having line `$n` already read into the
line buffer. This is pretty inconsistent; we fix it by always seeking
to the beginning of the line.
We also add a test case for the duplicate bug #46569.
Closes GH-6434.
Diffstat (limited to 'UPGRADING')
-rw-r--r-- | UPGRADING | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -516,6 +516,8 @@ PHP 8.0 UPGRADE NOTES - SPL: . SplFileObject::fgetss() has been removed. + . SplFileObject::seek() now always seeks to the beginning of the line. + Previously, positions >=1 sought to the beginning of the next line. . SplHeap::compare($a, $b) now specifies a method signature. Inheriting classes implementing this method will now have to use a compatible method signature. |