You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FixGH-8563, GH-8564: SplFileObject EOF handling for seek() and next()
spl_filesystem_file_read_ex() treated a NULL buffer from
php_stream_get_line as a successful read of an empty line, creating a
phantom cached line at EOF. This caused seek() to give inconsistent
results between SplFileObject and SplTempFileObject (GH-8563), and
next() to increment the line counter indefinitely past EOF (GH-8564).
Return FAILURE when php_stream_get_line returns NULL, matching the
behavior of the existing php_stream_eof check. In seek(), break out
of the loop on EOF instead of returning, so the post-loop cleanup
runs consistently. In next(), return early at EOF without incrementing.
Make __toString() return empty string at EOF instead of throwing.
ClosesGH-8563ClosesGH-8564
0 commit comments