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.
Exception::getTraceAsString
(PHP 5 >= 5.1.0)
Exception::getTraceAsString — 获取字符串类型的异常追踪信息
说明
final public string Exception::getTraceAsString
( void
)
以字符串类型返回异常追踪信息。
参数
此函数没有参数。
返回值
以字符串类型返回异常追踪信息。
范例
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}
