下面的代码,虽然在一台服务器上工作,但对另一台服务器不起作用
abstract class XCTemplate
{
private static $_instances = array();
public static function Instance($params = array())
{
$class = get_called_class();
if(!isset(self::$_instances[$class]))
{
self::$_instances[$class] = new $class($params);
}
return self::$_instances[$class];
}
}
我从上面的代码中得到的错误如下:
Fatal error: Call to undefined function get_called_class() in /home/mysite/public_html/wp-content/themes/mysite/Libray/class_template.php on line 36