#37960 [Opn->Bgs]: file_get_contents() returns false but is_readable() returns true
| From: | tony2001@php.net | Date: | Thu, 29 Jun 2006 10:37:46 +0000 |
| Subject: | #37960 [Opn->Bgs]: file_get_contents() returns false but is_readable() returns true | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98943@lists.php.net to get a copy of this message | ||
ID: 37960
Updated by: tony2001@php.net
Reported By: dmytton@php.net
-Status: Open
+Status: Bogus
Bug Type: *Web Server problem
Operating System: Windows 2000 (Windows NT WEB 5.0
PHP Version: 5.1.4
New Comment:
file_get_contents() returns *empty string* when the target file is
empty.
Do you think it should return something else?
Not PHP problem -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2006-06-29 10:31:56] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37960&edit=1