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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php dot net at chiefworks dot com
New email:
PHP Version: OS:

 

 [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: Thu Sep 19 16:01:27 2024 UTC