|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12570 feof () - no break on eof of socket
Submitted: 2001-08-04 20:43 UTC Modified: 2002-06-04 04:35 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: m dot leuffen at i-line dot net Assigned:
Status: Not a bug Package: Network related
PHP Version: 4.0.6 OS: SuSE 7.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
7 + 12 = ?
Subscribe to this entry?

 [2001-08-04 20:43 UTC] m dot leuffen at i-line dot net

I have a problem with the fsock-Funktions:

$sock = fsockopen ($ip, $port, &$errno, &$errstr, 30);
while (!feof ($sock)) {
  echo fgetc ($sock);
  flush ()
fclose ($sock);

This function hangs after correct output of the initial Data. (It seems that feof () ist false also on end of the $sock)

Or is there an other way to check if the end is reached?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-07 12:36 UTC]
status -> analyzed (!)
 [2001-08-07 13:20 UTC]
reproduced with latest CVS.
 [2002-01-28 09:42 UTC] pdesjardins at kamitech dot com
I have the same bug on RedHat 7.2.
Can I have a workaround for feof()?

 [2002-06-04 04:35 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 22:04:50 2022 UTC