1.__destruct
当对象销毁时候,自动调用方法
<?php
class show{
function __construct(){
}
}
?>
<?php
class show{
private $name;
private $big;
public function __construct($name){
$this->name=$name;
echo "{$name} 诞生了<br>";
}
public function __destruct(){
echo "{$this->name} 销毁了<br>";
}
}
$stu=new show('test');
?>