<span> 跳至 [1] </span> [全屏预览] <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush: php; auto-links: false; "><?php /* 作者 : shyhero 邮箱 : shyhero@outlook.com Q Q : 1757424878 */ class Demo{ private static $ob=null; private $name; private $age; private function __construct(){ } public static function makeOb(){ var_dump($a); if(self::$ob == null){ $c = __CLASS__; self::$ob = new $c(); } return self::$ob; } public function __set($tName,$value){ $this -> $tName = $value; } } $a = Demo::makeOb(); var_dump($a);</pre><div class="contentsignin">로그인 후 복사</div></div> <style type="text/css"> .code_report{float:right} .code_report div{ float: left; margin-left: 5px; background: url("/img/ask-icon.gif") no-repeat; padding: 6px 0 6px 15px; padding-left: 15px; height: 16px;} .code_report a{ background: url("/img/ask-icon.gif") 0 -160px no-repeat;padding-left: 20px; line-height: 15px;height: 16px; color: #333; text-decoration: none; display:inline-block; zoom:1; vertical-align: middle;} .code_report em{ height: 28px; line-height:28px; width: 14px; display: inline-block; float: left; background: url("/img/ask-icon.gif") top right;} </style>