php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20047 add: file() returns false on failure
Submitted: 2002-10-23 12:15 UTC Modified: 2002-10-24 14:03 UTC
From: info at e-novative dot de Assigned: philip (profile)
Status: Closed Package: Documentation problem
PHP Version: all OS: all
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: info at e-novative dot de
New email:
PHP Version: OS:

 

 [2002-10-23 12:15 UTC] info at e-novative dot de
The documentation for the file() function does not state explicitly that file will return false if the file does not exist. This is rather confirmed and can be cross-checked by looking at the readfile page, but it might be worth adding it though.

Then, shouldn?t the result data type be "mixed" instead of "array"?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-23 12:31 UTC] philip@php.net
The documentation should state it returns false, that will be added.  Regarding mixed, if that were the case then all functions would be documented as mixed, not very useful.  Let's leave that part alone.
 [2002-10-23 15:23 UTC] hholzgra@php.net
if boolean false is only returned on failure
then we do not change return type to "mixed"

the type in the proto is always the success-type

 [2002-10-24 14:03 UTC] philip@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


Thanks for the bug report!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 22:00:02 2025 UTC