PHP 4.0 Bug #7396: is_dir() doesn't work

From: Date: Sun, 22 Oct 2000 23:12:02 +0000
Subject: PHP 4.0 Bug #7396: is_dir() doesn't work
Groups: php.dev 
Request: Send a blank email to php-dev+get-35820@lists.php.net to get a copy of this message
From: whit@transpect.com Operating system: Linux PHP version: 4.0.3pl1 PHP Bug Type: Filesystem function related Bug description: is_dir() doesn't work This snippet works: $handle=opendir($homedir); while ($file = readdir($handle)) { $retval[count($retval)] = $file; } closedir($handle); sort($retval); $cnt=count($retval); echo "CNT: $cnt"; $int=0; while($int<$cnt) { if(!is_dir($retval[$int])) { echo "File: $retval[$int]<br>"; } else { echo "Dir: $retval[$int]<br>"; } $int++; } But if I change "if(!is_dir($retval[$int])) {" to "if(is_file($retval[$int])) {" it fails. The way it fails is that all of the files fail to match as files, and are shown prefixed by "Dir:". -- Edit Bug report at: http://bugs.php.net/?id=7396&edit=1

« previous php.dev (#35820) next »