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
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: 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

Pull Requests

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 11:01:32 2025 UTC