(PHP 5, PHP 7)
Exception::getTrace — Obtém a stack trace
Retorna a stack trace da exceção.
Esta função não possui parâmetros.
Retorna a stack trace da exceção como um array.
Exemplo #1 Exemplo da Exception::getTrace()
<?php
function test() {
throw new Exception;
}
try {
test();
} catch(Exception $e) {
var_dump($e->getTrace());
}
?>
O exemplo acima irá imprimir algo similar à:
array(1) {
[0]=>
array(4) {
["file"]=>
string(22) "/home/bjori/tmp/ex.php"
["line"]=>
int(7)
["function"]=>
string(4) "test"
["args"]=>
array(0) {
}
}
}