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); ?>

Error::getFile

(PHP 7, PHP 8)

Error::getFileGets the file in which the error occurred

Опис

final public Error::getFile(): string

Get the name of the file 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

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