Skip to content

Commit a97677c

Browse files
authored
UPGRADING: document SplFileObject iterator fixes in PHP 8.6 (#21753)
Add an SPL entry to section 1 covering the behavior changes from GH-8561, GH-8562, GH-8563, and GH-8564, so library authors can adapt code that relied on the prior desynced behavior.
1 parent d0d1627 commit a97677c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

UPGRADING

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ PHP 8.6 UPGRADE NOTES
5959
with empty data (e.g. to destroy the session) should implement the same
6060
logic in their updateTimestamp() method.
6161

62+
- SPL:
63+
. SplFileObject::next() now advances the stream when no prior current()
64+
call has cached a line. A subsequent current() call returns the new
65+
line rather than the previous one.
66+
. SplFileObject::fgets() no longer caches the returned line for
67+
subsequent current() calls. current() now re-reads from the current
68+
stream position instead of returning the line fgets() just returned.
69+
. SplFileObject::next() past EOF no longer increments key() without
70+
bound. SplFileObject::seek() past EOF now produces the same key()
71+
value as SplTempFileObject; the two previously returned different
72+
values.
73+
6274
- Standard:
6375
. Form feed (\f) is now added in the default trimmed characters of trim(),
6476
rtrim() and ltrim(). RFC: https://wiki.php.net/rfc/trim_form_feed

0 commit comments

Comments
 (0)