Exception::getFile
(PHP 5, PHP 7, PHP 8)
Exception::getFile — 创建异常时的程序文件名称
参数
此函数没有参数。
返回值
返回发生异常的程序文件名称。
示例
示例 #1 Exception::getFile()示例
<?php
try {
throw new Exception;
} catch(Exception $e) {
echo $e->getFile();
}
?>
以上示例的输出类似于:
/home/bjori/tmp/ex.php
+添加备注