<?php
class Person{
public $name;
public $age;
public function __construct($name,$age){
$this->name=$name;
$this->age=$age;
}
public function __destruct(){
echo $this->name."文件已经被销毁<br/>";
}
}
$p1=new Person("贾宝玉",13);
$p1=new Person("林黛玉",14);
$p1=new Person("薛宝钗",12);
$p1=new Person("晴雯",13);
?>
class Person{
public $name;
public $age;
public function __construct($name,$age){
$this->name=$name;
$this->age=$age;
}
public function __destruct(){
echo $this->name."文件已经被销毁<br/>";
}
}
$p1=new Person("贾宝玉",13);
$p1=new Person("林黛玉",14);
$p1=new Person("薛宝钗",12);
$p1=new Person("晴雯",13);
?>