www.5129.net > php CAllstAtiC

php CAllstAtiC

构造函数在new对象的时候才会调用,如果不调用构造函数的情况下$db就是空对象 你的单例中应该有一个公共的静态方法吧

当你的网站出现 Strict Standards: Non-static method ECMall::startup() should not be called statically in /htdocs/ecmall/index.php on line 22 Deprecated: Assigning the return value of new by reference is deprecated in /htdocs/ecm...

函数里可设置静态变量:static $call调用一次后,给它赋值true二次调用,发现其值为true,直接返回 查看原帖>>

网站地图

All rights reserved Powered by www.5129.net

copyright ©right 2010-2021。
www.5129.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com