From: laidbak6921 at yahoo dot com
Operating system: FreeBSD 4.7
PHP version: 4.3.10
PHP Bug Type: Directory function related
Bug description: dir::read() method doesn't return expected result
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 bug report at http://bugs.php.net/?id=32916&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32916&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32916&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32916&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32916&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32916&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32916&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32916&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32916&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32916&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32916&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32916&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32916&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32916&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32916&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32916&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32916&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32916&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32916&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32916&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32916&r=mysqlcfg