Posted by Paul Czubilinski on 05/06/06 21:13
Hello,
I have a problem with code like this (PHP 5.1.4):
fila A.php:
=======
include(B.php);
class document extends obj {
.........
}
file B.php:
=======
$GLOBALS['x']->new we();
function __autoload($class_name) {
...here is the code to load classes...
}
file C.php
=======
class we extends obj {
private $document;
function __construct() {
$this->document = new document();
}
}
The problem is that after loading A.php into browser, PHP cannot find
document class which is defined in the A.php file! The problem is even
more strange - if document class doesnt extends obj class than
everything is ok.
(The problem exact is that __autoload special function is called when
in file C.php constructor of class we try to make the document object
(all other classes like obj has been already loaded).
Do you have any idea what is wrong with that?
Paul
[Back to original message]
|