跳转到主要内容

gettraceasstring

Exception::getTraceAsString

Gets the stack trace as a string

ENTITY

final

public

string

Exception::getTraceAsString

Returns the Exception stack trace as a string.

ENTITY ENTITY

ENTITY

Returns the Exception stack trace as a string.

ENTITY

Exception::getTraceAsString example

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

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

    

ENTITY

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

ENTITY

Throwable::getTraceAsString