Dutch PHP Conference 2025 - Call For Papers

Error::getTraceAsString

(PHP 7, PHP 8)

Error::getTraceAsStringGets the stack trace as a string

Опис

final public Error::getTraceAsString(): string

Returns the stack trace as a string.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns the stack trace as a string.

Приклади

Приклад #1 Error::getTraceAsString() example

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

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

Поданий вище приклад виведе щось схоже на:

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

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top