ID: 48173
Updated by: [email protected]
Reported By: kevinpeno at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Windows Server 2008
PHP Version: 5.2.9
New Comment:
file_exists() doesn't care about include_path.
Previous Comments:
------------------------------------------------------------------------
[2009-05-06 23:56:21] kevinpeno at gmail dot com
I'm using windows build 5.2.9-2 NTS. This option was not selectable.
------------------------------------------------------------------------
[2009-05-06 23:54:36] kevinpeno at gmail dot com
Description:
------------
Using file_exists fails to find valid files within include_path when
using an __autoload. Removing file_exists() the required file is found
and loaded.
Safe mode is not enabled.
Reproduce code:
---------------
<?php
function __autoload( $classname )
{
$file = str_replace( '_', DIRECTORY_SEPARATOR, $classname ).'.php';
if( file_exists( $file ) )
{
require( $file );
return true;
}
else
{
return FALSE;
}
}
# Sets include path to the current directory just for easy testing.
set_include_path( realpath( dirname(__FILE__)
).DIRECTORY_SEPARATOR.PATH_SEPARATOR.get_include_path() );
$test = new Prefix_ClassName();
?>
Expected result:
----------------
File included class initialized.
Actual result:
--------------
Fatal error: Class 'Prefix_ClassName' not found.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48173&edit=1