php类,构造函数 静态变量实例
PHP实例代码如下:
<?php
class dispatcher {
private $config;
public static $o;
function __construct() {
echo 'sss';
}
public static function getinstance() {
if (!self::$o) {
self::$o = new dispatcher();
}
self::$o;
}
}
new dispatcher();文章网址:http://www.phprm.com/mxdx/fs3192.html
随意转载^^但请附上教程地址。