Class Load twice
| From: | Yui Hiroaki | Date: | Sat, 31 May 2008 09:11:34 +0000 |
| Subject: | Class Load twice | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-274892@lists.php.net to get a copy of this message | ||
hi!
Please take look at my code;
I have two files.
one of the two file is wrtten mail() function.
when load.php is loaded, mail(), written by MyClass.php,
os also loaded.
I just do not want to load mail() when load.php is load.
if you know how to solove it, please teach me it!
*********MyClass.php***********
<?php
$objRef=new MyClass("hui7gutWSFrh6zt");
$objRef->buff();
mail("aaa@example.com","test","test");
class MyClass{
Private $google;
function __construct($googleKEY){
$this->google=$googleKEY;
}
public function buff(){
echo $this->google;
}
}
?>
*********MyClass.php***********
<?php
function __autoload($class_name) {
include_once $class_name . '.php';
}
$obj = new MyClass();
?>
Regards,
Yui