|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2012-05-17 14:35 UTC] don dot binda at verizon dot net
 
-PHP Version: Irrelevant
+PHP Version: 5.4.0
  [2012-05-17 14:35 UTC] don dot binda at verizon dot net
  [2012-06-03 20:47 UTC] carloschilazo at gmail dot com
  [2013-01-23 21:43 UTC] sebak_pl1 at gazeta dot pl
  [2014-09-22 22:12 UTC] tim_siebels_aurich at yahoo dot de
  [2020-11-18 11:29 UTC] cmb@php.net
 
-Assigned To:
+Assigned To: cmb
  [2020-11-18 11:30 UTC] cmb@php.net
  [2020-11-30 15:04 UTC] cmb@php.net
  [2020-11-30 15:04 UTC] cmb@php.net
 
-Status: Assigned
+Status: Closed
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
Description: ------------ This is occurring in 5.4.0, although 5.4.x isn't an option under version. Appears to be related to (or same as) 46569: Calling fgets() after seek() to any non-zero line returns one line later than expected. seek(0) works fine and calling current() instead of fgets() also works correctly. Test script: --------------- Source file (temp.txt): Line 1 Line 2 Line 3 Line 4 Code: $f = new SplFileObject('temp.txt'); $f->seek(0); echo $f->fgets(); $f->seek(1); echo $f->fgets(); $f->seek(2); echo $f->fgets(); Expected result: ---------------- Line 1 Line 2 Line 3 Actual result: -------------- Line 1 Line 3 Line 4