php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #15723 dir->read() class/function fails when directory contains subdirectory '0'
Submitted: 2002-02-26 00:30 UTC Modified: 2002-02-26 16:47 UTC
From: php dot net at chiefworks dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.1.1 OS: Linux 2.4
Private report: No CVE-ID: None
 [2002-02-26 00:30 UTC] php dot net at chiefworks dot com
$d = dir('.');
while ($entry = $d->read()) {
 echo "$entry \n";
}
$d->close();

The above script works fine on mosth direcotries, but if the direcoty contains a subdirectory "0", it stops as soon as it gets to it and only outputs the . and .. entries.

Caleb

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-26 01:38 UTC] torben@php.net
I'm changing this to a documentation problem, since it should
be explained on the dir() manual page. It is explained
here: http://www.php.net/readdir, however.

The gist is that '0' evaluates to false in PHP.


Torben
 [2002-02-26 16:47 UTC] alindeman@php.net
This bug has been fixed in CVS.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 23:01:26 2024 UTC