Error::getFile
PHP function
Edit on GitHub ✎
(PHP 7, PHP 8)
Gets the file in which the error occurred
Description
Error::getFile(): string
Get the name of the file the error occurred.
Parameters Parameters
Return Values
Returns the filename in which the error occurred.
Examples
Error::getFile() example
php
<?php
try {
throw new Error;
} catch(Error $e) {
echo $e->getFile();
}
?>The above example will output something similar to:
output
/home/bjori/tmp/ex.phpSee Also
Throwable::getFile