array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'error.gettraceasstring.php', 1 => 'Error::getTraceAsString', ), 'up' => array ( 0 => 'class.error.php', 1 => 'Error', ), 'prev' => array ( 0 => 'error.gettrace.php', 1 => 'Error::getTrace', ), 'next' => array ( 0 => 'error.tostring.php', 1 => 'Error::__toString', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'pt_BR', 'path' => 'language/predefined/error/gettraceasstring.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7, PHP 8)
Error::getTraceAsString — Recupera a pilha de rastreio como uma string
Recupera a pilha de rastreio como uma string.
Esta função não possui parâmetros.
Recupera a pilha de rastreio como uma string.
Exemplo #1 Exemplo do método Error::getTraceAsString()
<?php
function test() {
throw new Error;
}
try {
test();
} catch(Error $e) {
echo $e->getTraceAsString();
}
?>
O exemplo acima produzirá algo semelhante a:
#0 /home/bjori/tmp/ex.php(7): test() #1 {main}