|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25343 Is_Dir() gives warning
Submitted: 2003-09-01 08:20 UTC Modified: 2003-09-01 20:23 UTC
From: patric at liefdeis dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.3.3 OS: FreeBSD 4.3
Private report: No CVE-ID:
 [2003-09-01 08:20 UTC] patric at liefdeis dot com
When I run is_dir() on FreeBSD 4.3, and the file I check is not a dir, I get a warning, about that the file is not a dir (duh, that is what I am checking for :p). On Windows systems I don't have this problem.
Temporary solved the problem by using @is_dir(). But I believe it is not very logic.

Reproduce code:
if (is_dir("file.txt")) {
  echo "This shouldn't be a dir";
} else {
  echo "burp";

Expected result:

Actual result:
Warning: is_dir(): Stat failed for /www/site/file.txt (errno=20 - Not a directory) in /www/site on line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-01 20:23 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Dec 01 21:01:34 2015 UTC