ID: 39542
User updated by: snowy at corporatezoo dot com
Reported By: snowy at corporatezoo dot com
Status: Open
Bug Type: Scripting Engine problem
Operating System: Windows XP
PHP Version: 5.2.0
New Comment:
tony, sorry I just realised that example might be different in linux
because of being case sensitive.
could you try renaming the files and class name to "index"... ie,
"../classes/index.php" and "class index".
See which one it tries to load up first. thx
Previous Comments:
------------------------------------------------------------------------
[2006-11-17 11:35:53] [EMAIL PROTECTED]
Not reproducible on Linux.
------------------------------------------------------------------------
[2006-11-17 06:24:25] snowy at corporatezoo dot com
Description:
------------
Behaviour of require/include different to < 5.2.0.
I'm not sure if this is by design, couldn't find any reference to it in
release notes. Basically, the search order of an include seems to always
start with ./ instead of in the order of get_include_path(). This is
problematic, esp in the case of using autoload, where a filename eg in
./index.php might be the same as ../classes/Index.php, ./index.php gets
autoloaded instead of ../classes/Index.php
Reproduce code:
---------------
//index.php
set_include_path('../classes;.');
function __autoload($class)
{
if (!require_once($class.'.php')) {
error_log('Error: Autoload class: '.$class.' not found!');
}
}
$index = new Index();
//../classes/Index.php
class Index
{
//blah
}
Expected result:
----------------
In 5.1.6, it works ok, loads Index.php
Actual result:
--------------
in 5.2.0,
Fatal error: Class 'Index' not found in c:\docroot\index.php
I suspect it's looking for a class in index.php (Which is the currently
executed script).
Is this an architectural change? Or is this a bug?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39542&edit=1