(PHP 5, PHP 7)
Exception::getTrace — Gibt den Stacktrace zurück
Gibt den Stacktrace der Exception zurück.
Diese Funktion besitzt keine Parameter.
Gibt den Stacktrace der Exception als Array zurück.
Beispiel #1 Exception::getTrace()-Beispiel
<?php
function test() {
throw new Exception;
}
try {
test();
} catch(Exception $e) {
var_dump($e->getTrace());
}
?>
Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
array(1) {
[0]=>
array(4) {
["file"]=>
string(22) "/home/bjori/tmp/ex.php"
["line"]=>
int(7)
["function"]=>
string(4) "test"
["args"]=>
array(0) {
}
}
}