Error
PHP Manual

Error::getTraceAsString

(No version information available, might only be in Git)

Error::getTraceAsStringGets the stack trace as a string

Beschreibung

final public string Error::getTraceAsString ( void )

Returns the stack trace as a string.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns the stack trace as a string.

Beispiele

Beispiel #1 Error::getTraceAsString() example

<?php
function test() {
    throw new 
Error;
}

try {
    
test();
} catch(
Error $e) {
    echo 
$e->getTraceAsString();
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

#0 /home/bjori/tmp/ex.php(7): test()
#1 {main}

Siehe auch


Error
PHP Manual