Exception::getFile
(PHP 5, PHP 7, PHP 8)
Exception::getFile — 建立異常時的程式檔名稱
說明
final public Exception::getFile(): string
獲取建立異常的程式檔名稱。
參數
此函式沒有參數。
返回值
返回發生異常的程式檔名稱。
範例
示例 #1 Exception::getFile()示例
<?php
try {
throw new Exception;
} catch(Exception $e) {
echo $e->getFile();
}
?>
以上例程的輸出類似於:
/home/bjori/tmp/ex.php