php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #10492 fgetc return value (FALSE=EOF ... maybe)
Submitted: 2001-04-25 11:09 UTC Modified: 2001-04-25 11:12 UTC
From: eheckers at users dot sourceforge dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.0.4pl1 OS: Linux
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: eheckers at users dot sourceforge dot net
New email:
PHP Version: OS:

 

 [2001-04-25 11:09 UTC] eheckers at users dot sourceforge dot net
According to the manula fgetc returns value FALSE
if the eof is reached.

This is true but the problem is that it also returns
FALSE if a '0' is read from the file.

The return value FALSE of fgetc() should not be used to test the EOF condition.

It is better to drop that line from the documentation and
add a reference for using feof() to test for the EOF condition.

Bye,
   Erik.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-25 11:12 UTC] derick@php.net
You need to use === FALSE in this case, to check for the type too. If this is what you are doing, please reopen this bug report and include a short reproducing script.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC