PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Exception::getTraceAsString> <Exception::getLine
Last updated: Fri, 10 Oct 2008

view this page in

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) {
    }
  }
}



add a note add a note User Contributed Notes
Exception::getTrace
There are no user contributed notes for this page.

Exception::getTraceAsString> <Exception::getLine
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites