(PHP 5 >= 5.1.0)
Exception::getTraceAsString — 获取字符串类型的异常追踪信息
以字符串类型返回异常追踪信息。
此函数没有参数。
以字符串类型返回异常追踪信息。
Example #1 Exception::getTraceAsString()示例
<?php
function test() {
throw new Exception;
}
try {
test();
} catch(Exception $e) {
echo $e->getTraceAsString();
}
?>
以上例程的输出类似于:
#0 /home/bjori/tmp/ex.php(7): test() #1 {main}
Lucas W (2013-02-20 10:13:13)
This method may be very slow and affecting your apache to use all his resources. You will meet performance problems if stack trace is huge (big array in some object). This happens because PHP don't "like" to concatenate big stings info one - it works really slow.