note 76323 deleted from language.oop5.autoload by felipe
| From: | felipe@php.net | Date: | Mon, 24 Mar 2008 22:41:38 +0000 |
| Subject: | note 76323 deleted from language.oop5.autoload by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137502@lists.php.net to get a copy of this message | ||
Note Submitter: torch at torchs dot net
----
I have just noticed that __autoload function is also called when extending classes.
For example:
<?php
// This is file called class.test1.php
class test1
{
/* class body */
}
?>
<?php
// This is file class.test2.php
class test2 extends test1
{
/* class body */
}
?>
<?php
// This is the file that contains __autoload
function __autoload($class)
{
require_once($class . ".php");
}
?>
The file "class.test1.php" will be reqire'd even though it is not implicitly called
by new keyword.