I have strange problem with autoload function. I have this code:
function __autoload($class) {
echo "in autoload function: ".$class."<br/>";
require_once $class.".php";
}
TestClass::testMethod();
echo is_file("Debug.php") ? " file exist " : "file not exist";
echo "<br/>";
echo class_exists('Debug') ? "class exist" : "class not exist";
Debug::getIncludeExecutionTime($include, $time);
And output is:
in autoload function: TestClass
file exist
class not exist
Fatal error: Class 'Debug' not found in Z:[my local host path] on line 207
So, there is misseed 'in autoload function Debug'. Most strangest there - if I invoke Debug class in other function, or in other place, autoload work.
Why autoload function was not invoked? What can be reasons? There is no spl_autoload_register functions on project.