-4
代碼波紋管,而在一臺服務器工作不工作到另一個奇怪的錯誤,工作在一臺服務器,但不是在其他
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
http://www.php.net/manual/en/function.get-called-class.php:(PHP 5> = 5.3.0)' - 所以很可能你的機器版本較低你得到錯誤的地方。 (順便說一下,自己看這本手冊會很難嗎?) – CBroe