php.net |  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
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: chocobot at gmx dot de
New email:
PHP Version: OS:

 

 [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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-19 09:22 UTC] eru@php.net
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

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

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC