PHP 4.0 Bug #6151: The function is_dir seems to behave wrong
| From: | cedric dot schaller at sonar dot ch | Date: | Mon, 14 Aug 2000 19:03:00 +0000 |
| Subject: | PHP 4.0 Bug #6151: The function is_dir seems to behave wrong | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28841@lists.php.net to get a copy of this message | ||
From: cedric.schaller@sonar.ch
Operating system: Solaris 5
PHP version: 4.0.0
PHP Bug Type: Misbehaving function
Bug description: The function is_dir seems to behave wrong
<?
$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