Exception::getTrace
(PHP 5 >= 5.1.0)
Exception::getTrace — スタックトレースを取得する
説明
final public array Exception::getTrace
( void
)
例外のスタックトレースを返します。
パラメータ
この関数にはパラメータはありません。
返り値
例外のスタックトレースを配列で返します。
例
例1 Exception::getTrace() の例
<?php
function test() {
throw new Exception;
}
try {
test();
} catch(Exception $e) {
var_dump($e->getTrace());
}
?>
上の例の出力は、たとえば 以下のようになります。
array(1) { [0]=> array(4) { ["file"]=> string(22) "/home/bjori/tmp/ex.php" ["line"]=> int(7) ["function"]=> string(4) "test" ["args"]=> array(0) { } } }
Exception::getTrace
There are no user contributed notes for this page.
