|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10898 is_dir && filetype return wrong values
Submitted: 2001-05-16 05:44 UTC Modified: 2001-05-17 03:13 UTC
From: yves at monet dot be Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.0.5 OS: Win ME & Win NT 4.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
47 - 34 = ?
Subscribe to this entry?

 [2001-05-16 05:44 UTC] yves at monet dot be

I'm running php 4.0.5 on my win ME & Win NT 4.0 and I have experienced 2 functions returning the wrong values. I don't know if this bug is allready reported.

the is_dir() allways returns false except for "." && ".."
the filetype() allways returns dir


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-16 06:23 UTC]
Please provide a short script so that we can reproduce it.

 [2001-05-16 08:35 UTC] yves at monet dot be
A little script that should echo alle filetypes of all files in any subdir of the parent provided. 
Now I use opendir to test wether the file is a dir, but this isn't a good solution, is it?

The is_dir() allways returns false
the filetype() allwyas returns dir


function getFileInfo($parent)
	$handle = opendir($parent);
	while ($file = readdir($handle))
		$filelist[]=$file ;

	while(list(,$f)=each ($filelist))
		if ($f!="." && $f!="..")
                       echo filetype($f);



 [2001-05-16 10:53 UTC]
this is bogus. you have to either chdir() into the $parent or is_dir() the full path.
 [2001-05-17 03:13 UTC] yves at monet dot be

than the docs in my book are wrong, it says file instead of path. Sorry for wasting your time...
 [2002-05-25 15:10 UTC] skamp at tele2 dot co dot uk
That maybe the case - however this worked in version 4.0.4 but  doesn't from 4.0.6 onwards.  I've just spent all afternoon wondering why my pages don't work in 4.2.1 - going back to 4.0.4 fixed it.  Similarly trying to get the argument passed via a url after the ? worked OK in 4.0.4 but no longer.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Sep 30 23:05:52 2022 UTC