Bug->Doc #54673 [Opn->Bgs]: readdir(false) returns NULL
| From: | salathe@php.net | Date: | Fri, 06 May 2011 08:41:34 +0000 |
| Subject: | Bug->Doc #54673 [Opn->Bgs]: readdir(false) returns NULL | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6352@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54673&edit=1
ID: 54673
Updated by: salathe@php.net
Reported by: chealer at gmail dot com
Summary: readdir(false) returns NULL
-Status: Open
+Status: Bogus
-Type: Bug
+Type: Documentation Problem
Package: Directory function related
PHP Version: 5.3.6
-Assigned To:
+Assigned To: salathe
Block user comment: N
Private report: N
New Comment:
The fact that most functions now return NULL if you feed in bad
parameters is
documented already. See the note on
http:/www.php.net/manual/en/functions.internal.php
Previous Comments:
------------------------------------------------------------------------
[2011-05-06 08:00:38] chealer at gmail dot com
Description:
------------
According to http://php.net/readdir readdir "Returns the
filename on
success or FALSE on failure." As reported in #52383, since PHP 5.3
readdir may also return NULL on failure.
The regression can be seen here:
# php -r 'var_dump(phpversion(), @readdir(false),
@readdir(false)===false);'
string(8) "5.2.11-2"
bool(false)
bool(true)
$ php -r 'var_dump(phpversion(), @readdir(false),
@readdir(false)===false);'
string(8) "5.3.6-10"
NULL
bool(false)
According to the first bullet on
http://php.net/manual/en/migration53.incompatible.php
this would be an
intentional change, so this would be a documentation bug.
Test script:
---------------
var_dump(@readdir(false));
Expected result:
----------------
bool(false)
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54673&edit=1