跳转到主要内容

gettraceasstring

Error::getTraceAsString

Gets the stack trace as a string

ENTITY

final

public

string

Error::getTraceAsString

Returns the stack trace as a string.

ENTITY ENTITY

ENTITY

Returns the stack trace as a string.

ENTITY

Error::getTraceAsString example

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

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

    

ENTITY

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

ENTITY

Throwable::getTraceAsString