|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10856 is_dir() does only recognize . and .. as directory, nothing else
Submitted: 2001-05-14 14:04 UTC Modified: 2001-05-14 14:32 UTC
From: marc at links2linux dot de Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 4.0.4pl1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: marc at links2linux dot de
New email:
PHP Version: OS:


 [2001-05-14 14:04 UTC] marc at links2linux dot de
 $d = dir("/");
 echo "Handle: ".$d->handle."<br>\n";
 echo "Path: ".$d->path."<br>\n";
 while($entry=$d->read()) {
     if (is_dir($entry)) echo "[DIR]";
     echo $entry."<br>\n";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-14 14:18 UTC]

this is a little error in your logic,
$d->read() returns a string, and the is_dir() only checks in the _current_ directory for that string.
Aparrantly you don't have (p.e.) bin in your current dir, so is_dir() failed on it.
I'm checking if I can make this a warning, but I'm closing this report now, because it's not a bug.

 [2001-05-14 14:32 UTC]
Ok, I bumbed up the error level from E_NOTICE to E_WARNING.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 08:01:27 2024 UTC