獲取錯誤發生時的檔案

Error::getFile

(PHP 7, PHP 8)

Error::getFile — 獲取錯誤發生時的檔案

說明

final public Error::getFile(): string

獲取錯誤發生時的檔名稱。

參數

此函式沒有參數。

返回值

返回錯誤發生時的檔名。

範例

示例 #1 Error::getFile() 例子

<?php
try {
    throw new 
Error;
} catch(
Error $e) {
    echo 
$e->getFile();
}
?>

以上例程的輸出類似於:

/home/bjori/tmp/ex.php

參見

Leave a Reply

Your email address will not be published. Required fields are marked *