123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace loyalsoft;
- include __DIR__ . '/main.php';
- //require_once ROOTDIR . '/Util/OpenSSLVerify.php'; # Ps. 这个文件和类名没有对应关系.
- //header('X-Accel-Buffering: no'); # nginx 控制头, 关闭buffer
- //set_time_limit(15); # 设置执行超时时间
- echoLine("phpver:" . PHP_VERSION);
- class ABC {
- public $age;
- public $name = "wg";
- static $_ins;
- public static function Ins() {
- if (null == self::$_ins) {
- self::$_ins = new ABC();
- }
- return self::$_ins;
- }
- }
- $abc = new ABC();
- $abc->age = 33;
- function Get() {
- return ABC::Ins();
- }
- $ref = Get();
- $ref->name = "中国年";
- $ref = $abc;
- $ref->name = "王刚";
- var_dump($ref);
- var_dump(ABC::Ins());
|