php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6151 The function is_dir seems to behave wrong
Submitted: 2000-08-14 15:03 UTC Modified: 2000-08-14 17:09 UTC
From: cedric dot schaller at sonar dot ch Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 OS: Solaris 5
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cedric dot schaller at sonar dot ch
New email:
PHP Version: OS:

 

 [2000-08-14 15:03 UTC] cedric dot schaller at sonar dot ch
<?
$path="$DOCUMENT_ROOT/site/documents";
$current_dir=opendir($path);
while ($file=readdir($current_dir)) {
	if (is_dir($file))
		echo "dir";
       	if ($file != "." && $file != "..")
        		echo "$file\n"; 
        	if (is_dir($file) && $file != "." && $file != "..")
        		echo "$file\n"; 

}
?>

In this program, I have 3 "if conditions". The 3rd is actually the two first put together. But the 2 first are evaluated as true and the third as wrong. 

Thanks for having a look at it. 

Cedric Schaller

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 00:01:34 2024 UTC