摘要: <?php //单例模式 /*class Ren { public $name; } $r = new Ren(); $r1 = new Ren(); */ class DA { public $name; static private $dx;//存放对象的变量 //将构造变为私有,外界没法造对象 阅读全文
posted @ 2016-06-08 15:44 世界真奇妙 阅读(197) 评论(1) 推荐(0) 编辑
摘要: /*//设计模式:程序进行设计用的,工厂模式 class YunSuan { public $a; public $b; public $f; function Jia() { return ($this->a+$this->b); } function Jian() { return ($this 阅读全文
posted @ 2016-06-08 09:30 世界真奇妙 阅读(90) 评论(0) 推荐(0) 编辑
摘要: class Ren { public $name; public $sex; function __construct($n,$s) { $this->name = $n; $this->sex = $s; } function __clone() { $this->name = "李四";//th 阅读全文
posted @ 2016-06-08 09:30 世界真奇妙 阅读(310) 评论(0) 推荐(0) 编辑