Reply to classes: strange behavior

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация