php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37960 file_get_contents() returns false but is_readable() returns true
Submitted: 2006-06-29 10:31 UTC Modified: 2006-06-29 10:37 UTC
From: dmytton@php.net Assigned:
Status: Not a bug Package: *Web Server problem
PHP Version: 5.1.4 OS: Windows 2000 (Windows NT WEB 5.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dmytton@php.net
New email:
PHP Version: OS:

 

 [2006-06-29 10:31 UTC] dmytton@php.net
Description:
------------
file_get_contents() returns false but is_readable() returns true where file.php is a blank PHP file (0 bytes) with full world writable permissions.

phpinfo() output at http://www.cabalonline.com/bug/php.php

Server API: CGI/FastCGI

Reproduce code:
---------------
<?php
if (!file_get_contents('file.php'))
{
	echo 'file_get_contents: false';
}
else
{
	echo 'file_get_contents: true';
}
?>
<br />
<?php
if (!is_readable('file.php'))
{
	echo 'is_readable: false';
}
else
{
	echo 'is_readable: true';
}
?>

Expected result:
----------------
file_get_contents: true
is_readable: true

Actual result:
--------------
file_get_contents: false
is_readable: true

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-29 10:37 UTC] tony2001@php.net
file_get_contents() returns *empty string* when the target file is empty.
Do you think it should return something else?
Not PHP problem -> bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 05:01:28 2024 UTC