Re: strange autoload behavior

From: Date: Thu, 10 Jul 2008 19:06:02 +0000
Subject: Re: strange autoload behavior
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-38909@lists.php.net to get a copy of this message
Hi Dan,
The error was clear: the file containing the class foo was not found. But before I made my post, I did run your test, just to make sure. It worked fine[1] -- because my include_path is set to look at the current directory first. If you used my sample correctly you should get the same result and the cause is already explained by Derick.
Just because something is in the same directory doesn't mean it gets included first. If the path is not specified (either by fully qualified path (/var/www/test) or by relative path (./) the include_path is used. Sorry but this is not true, check the manual:
"Files for including are first looked for in each include_path entry relative to the current working directory, and then in the directory of current script." Best Regards, Felhő p.s.: I run into this problem using amfphp which overwrites the error handler with a function which simply convert the error to an excepton.

« previous php.internals (#38909) next »