平时作业题目 发上来 同学们一起学习
class Goods{
private $Name;
private $Price;
private $Color;
private $type;
private $goods;
private function __construct($Name,$Price,$Color,$type){
$this->Name=$Name;
$this->Price=$Price;
$this->Color=$Color;
$this->type=$type;
}
function getIstance(){
if($goods==null)
$goods=new Goods("面包",3.5,"橙黄","食品");
return $goods;
}
function __destruct(){
echo "清除价格",$this->Price;
}
}
Goods::getIstance();
?>