Doc #51208 [Opn]: fgets return values
| From: | serphen at gmail dot com | Date: | Fri, 05 Mar 2010 01:25:43 +0000 |
| Subject: | Doc #51208 [Opn]: fgets return values | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4010@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51208&edit=1
ID: 51208
User updated by: serphen at gmail dot com
Reported by: serphen at gmail dot com
Summary: fgets return values
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: N/A
PHP Version: 5.3.1
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2010-03-05 02:24:52] 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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51208&edit=1