4,249
社区成员




class bass {
function __construct() {
$this->_initialize();
}
function _initialize() {
static $v;
@$v++;
if($v == 1 && method_exists($this, 'initialize')) $this->initialize();
}
}
class a extends bass {
function initialize() {
echo __CLASS__;
}
}
class b extends bass {
function initialize() {
echo __CLASS__;
}
}
$obj = new a();
$obj = new a();
$obj = new a();
$obj = new b();
$obj = new b();
$obj = new b();
ab