Exception
PHP 手册

Exception::getFile

(PHP 5 >= 5.1.0)

Exception::getFileGets the file in which the exception occurred

说明

final public string Exception::getFile ( void )

Get the name of the file the exception was thrown from.

参数

This function has no parameters.

返回值

Returns the filename in which the exception was thrown.

范例

Example #1 Exception::getFile() example

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

上例的输出类似于:

/home/bjori/tmp/ex.php


Exception
PHP 手册