<?php
func.php
class FUNC{
public $tpl;
public $init;
public $charset;
function __construct(){
global $init,$config;
$this->tpl = $tpl;
$this->init = $init;
$this->charset = $config['setting']['charset'];
}
?>
<?php
logging.php
class logging {
public $tpl;
public $init;
public $db;
public $func;
function __construct(){
global $tpl,$init,$db,$func;
$this->tpl = $tpl;
$this->init = $init;
$this->db = $db;
$this->func = $func;
}
?>
如果在index.php同时初始化这两个lei就会出现500错误。
估计是都global了相同的东西,如何才能解决这个问题呢?