|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15621 directory with name '0' isn't listed
Submitted: 2002-02-19 09:10 UTC Modified: 2002-02-19 09:22 UTC
From: chocobot at gmx dot de Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 4.1.1 OS: Linux Redhat
Private report: No CVE-ID: None
 [2002-02-19 09:10 UTC] chocobot at gmx dot de
i have a directory containing other directories, including one named '0'.
I try to use "while ($file = readdir($handle))" to go throug all entries, but none get listed! 
As soon as i rename that dir to something else, it works as expected.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-19 09:22 UTC]
This is not a bug. Please double-check the documentation available
at and the instructions on how to report
a bug at

You should use
while (false !== ($file = readdir ($handle)))

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 19:05:48 2023 UTC