array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), 'this' => array ( 0 => 'error.getfile.php', 1 => 'Error::getFile', 2 => 'Gets the file in which the error occurred', ), 'up' => array ( 0 => 'class.error.php', 1 => 'Error', ), 'prev' => array ( 0 => 'error.getcode.php', 1 => 'Error::getCode', ), 'next' => array ( 0 => 'error.getline.php', 1 => 'Error::getLine', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'language/predefined/error/getfile.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 7, PHP 8)
Error::getFile — Gets the file in which the error occurred
Get the name of the file the error occurred.
Questa funzione non contiene parametri.
Returns the filename in which the error occurred.
Example #1 Error::getFile() example
<?php
try {
throw new Error;
} catch(Error $e) {
echo $e->getFile();
}
?>Il precedente esempio visualizzerĂ qualcosa simile a:
/home/bjori/tmp/ex.php