|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-06 23:56 UTC] kevinpeno at gmail dot com
[2009-05-07 07:58 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
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.