//////////////// class desktop{ var $desktop;#桌子面; var $baluster;#桌子腿; function desktop(){ $this->desktop = 100; $this->baluster = 100; } function move(){ #.... } function largen(){ $this->desktop++;#放大桌子面 } } //////////// 看到了吧,我把桌子定义了大小和长度哦 ////////// |
////////////// class desktop{ var $desktop;#桌子面; var $baluster;#桌子腿; function desktop(){ $this->desktop = 100; $this->baluster = 100; } function move(){ #.... } function largen(){ $this->desktop++;#放大桌子面 } } $d = new desktop; $d->desktop(); //////////////////// |
function desktop(){ $this->desktop = 100; $this->baluster = 100; } |
////////////// <? class desktop{ var $desktop;#桌子面; var $baluster;#桌子腿; function desktop(){ $this->desktop = 100; $this->baluster = 100; echo "我们桌子家族命令大家把桌子面子都给我统一在".$this->desktop."大小!<br />"; } function move(){ #.... } function largen(){ $this->desktop++;#放大桌子面 echo "7~,小桌子我今天改造了,不鸟你们拉,哈哈, 我现在面子可比你们大,我有".$this->desktop."嘎嘎"; } } $d = new desktop; $d->largen(); ?> |
////////////// <? class desktop{ var $desktop;#桌子面; var $baluster;#桌子腿; function desktop($desktop){ $this->desktop = $desktop; $this->baluster = 100; echo "我们桌子家族命令大家把桌子面子都给我统一在".$this->desktop."大小!<br />"; } function move(){ #.... } function largen(){ $this->desktop++;#放大桌子面 echo "7~,小桌子我今天改造了,不鸟你们拉,哈哈, 我现在面子可比你们大,我有".$this->desktop."嘎嘎"; } } $d = new desktop; $d->largen(); ?> |
///// $d = new desktop(101); //// |