php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40164 filetype() generates wrong error message type
Submitted: 2007-01-19 09:44 UTC Modified: 2007-01-19 10:04 UTC
From: pcdinh at gmail dot com Assigned:
Status: Not a bug Package: Compile Warning
PHP Version: 5.2.0 OS: Windows
Private report: No CVE-ID: None
 [2007-01-19 09:44 UTC] pcdinh at gmail dot com
Description:
------------
The PHP Manual said: filetype() will also produce an E_NOTICE message if the stat call fails or if the file type is unknown.

However, in fact, with PHP 5.2.0, Windows Xp Sp2, a E_WARNING message is returned:
Warning: filetype() [function.filetype]: Lstat failed for W:/ in D:\wvbsrc\mailing\demos\lib\core\WVB\View\Drivers\WVB_View_Standard.php on line 73


Reproduce code:
---------------
if (filetype('W:/') === false)
{
	echo "Hello";
}

Expected result:
----------------
Notice: filetype() [function.filetype]: Lstat failed for W:/ in D:\wvbsrc\mailing\demos\lib\core\WVB\View\Drivers\WVB_View_Standard.php on line 73

Actual result:
--------------
Warning: filetype() [function.filetype]: Lstat failed for W:/ in D:\wvbsrc\mailing\demos\lib\core\WVB\View\Drivers\WVB_View_Standard.php on line 73

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-19 10:04 UTC] tony2001@php.net
The manual says of another one possible error message.
This error message is "Unknown file type (..)" and it's indeed E_NOTICE.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 08:01:23 2020 UTC