php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15932 file_exists generates a verbose warning in addition to return code.
Submitted: 2002-03-07 07:58 UTC Modified: 2002-03-08 06:17 UTC
From: eweik at ls-dmd dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.1.2 OS: Linux
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: eweik at ls-dmd dot com
New email:
PHP Version: OS:

 

 [2002-03-07 07:58 UTC] eweik at ls-dmd dot com
Upon upgrading to PHP 4.1.2, all calls which use the file_exists() function to verify files within a non-existent sub-directory, are generating a stat warning (which was not the case in 4.0.6). 

Example code:
if (file_exists($dir.'/filename.ext')) { 
  FOO;
}

If $dir doesn't exist, the following warning is generated:

Warning: stat failed for dir/filename.exe (errno=20 - Not a directory) in script.php on line n.

This is easily silenced by calling @file_exists instead, but it doesn't seem like the desired behavior.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-08 06:17 UTC] sander@php.net
This bug has already been fixed in CVS.
 [2003-06-16 05:08 UTC] jesse at clatsopwebdesign dot com
This bug still exists in php 4.3.1 on my FreeBSD server
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 16:01:27 2024 UTC