/** * 脚本执行完毕后调用的动作 * * @access public * @return mixed */ public static function exitScript() { $xdebug = get_extension_funcs("xdebug"); if (self::$_iserror && !is_array($xdebug)) { //过滤掉html标签 $error = ob_get_contents(); if (ob_get_length() > 0) { ob_end_clean(); } if (preg_match('/(?P<errorType>[^:]+):\\s(?P<message>.+(?=in))in\\s(?P<file>.+(?=on))on\\sline\\s(?P<line>.+)/', $error, $matches)) { Tiny::handleError(E_PARSE, $matches['message'], trim(strip_tags($matches['file'])), strip_tags($matches['line']), get_defined_vars()); } else { echo $error; } } }