#32916 [Opn->Bgs]: dir::read() method doesn't return expected result
| From: | johannes@php.net | Date: | Mon, 02 May 2005 21:07:41 +0000 |
| Subject: | #32916 [Opn->Bgs]: dir::read() method doesn't return expected result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78535@lists.php.net to get a copy of this message | ||
ID: 32916
Updated by: johannes@php.net
Reported By: laidbak6921 at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Directory function related
Operating System: FreeBSD 4.7
PHP Version: 4.3.10
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
dir::read() returns a string with a filename, no bool.
Previous Comments:
------------------------------------------------------------------------
[2005-05-02 21:37:58] laidbak6921 at yahoo dot com
Description:
------------
The dir class method read works if using it just the way it is stated
in the documentation, however, if I re-write it to use TRUE=== it
fails. See code example:
Reproduce code:
---------------
Original Code Snippet:
<?php
$d = dir("/etc/php5");
echo "Handle: " . $d->handle . "\n";
echo "Path: " . $d->path . "\n";
while (false !== ($entry = $d->read())) {
echo $entry."\n";
}
$d->close();
?>
MODIFIED:
while (false !== ($entry = $d->read())) {
TO:
while (true === ($entry = $d->read())) {
Expected result:
----------------
Expected the alternative version to return true, but it did not.
Actual result:
--------------
Code returned false.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32916&edit=1