php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51208 fgets return values
Submitted: 2010-03-05 02:24 UTC Modified: 2010-10-20 08:46 UTC
From: serphen at gmail dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.1 OS: N/A
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: serphen at gmail dot com
New email:
PHP Version: OS:

 

 [2010-03-05 02:24 UTC] serphen at gmail dot com
Description:
------------
According to PHP documentation, fgets is supposed to return (String)NULL and only FALSE when a error happens.
The behaviour in 5.3 doesn

Test script:
---------------
if (fgets(...) === false)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-05 02:25 UTC] serphen at gmail dot com
According to PHP documentation, fgets is supposed to return (String)NULL and only FALSE when a error happens.
The behaviour in 5.3 doesn t actually match the documentation, it returns FALSE on all errors including the case there isn't any more data to read.

I believe "FALSE all the time" is the implementation the core devs wanted to have and this is not a core-bug but a doc-bug.

Arnaud Granal.
 [2010-10-20 08:46 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304534
Log: Fixed bug #51208 (fgets return values)
 [2010-10-20 08:46 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-10-20 08:46 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=89fd31bb2e806fc27ea687df43ad438ce06d5dbb
Log: Fixed bug #51208 (fgets return values)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 12:00:01 2026 UTC