note 85977 added to function.include
| From: | AntonioCSatgmaildotcom at osu1 dot php dot net | Date: | Fri, 26 Sep 2008 17:39:57 +0000 |
| Subject: | note 85977 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144819@lists.php.net to get a copy of this message | ||
Include and Require will call the __autoload function if the file that is being called extends some
other class
Example Code:
File teste.php
<?php
class teste extends motherclass {
public function __construct() {
parent::__construct();
}
}
?>
File example.php
<?php
require("teste.php");
if (class_exists("motherclass"))
echo "It exists";
?>
You will be given the output:
It exists
I think the __autoload function should be called when I instantiate the teste class not when I
include/require the file.
----
Server IP: 194.8.30.16
Probable Submitter: 193.126.240.190
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- https://master.php.net/note/edit/85977
Del: integrated -- https://master.php.net/note/delete/85977/integrated
Del: useless -- https://master.php.net/note/delete/85977/useless
Del: bad code -- https://master.php.net/note/delete/85977/bad+code
Del: spam -- https://master.php.net/note/delete/85977/spam
Del: non-english -- https://master.php.net/note/delete/85977/non-english
Del: in docs -- https://master.php.net/note/delete/85977/in+docs
Del: other reasons-- https://master.php.net/note/delete/85977
Reject -- https://master.php.net/note/reject/85977
Search -- https://master.php.net/manage/user-notes.php