array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), '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
У цієї функції немає параметрів.
Returns the filename in which the error occurred.
Приклад #1 Error::getFile() example
<?php
try {
throw new Error;
} catch(Error $e) {
echo $e->getFile();
}
?>
Поданий вище приклад виведе щось схоже на:
/home/bjori/tmp/ex.php