在命名空间下的类,导入trait 如何实现单例模式实例化
<?php
//namespace traitname;
include_once"trait.php";
class lui{
use tu,one;
private static $cs=null;
private function __constrouct(){
}
private function __clone(){
}
public function qname($vname){
$this->name=$vname;
}
public static function xinif(){
if(!(self::$cs instanceof self)){
self::$cs = new self();
}
return self::$cs;
}
}
?>