getFile
Returns the full path to the file that threw the exception.
getFile() method returns the absolute path to the file where the exception occurred.
Tutorial: PHP exception
Throw an exception and output the path to the file where the exception occurred:
<?php
try {
throw new Exception ( "An error occurred" ) ;
} catch ( Exception $e ) {
echo "Error in this file: " . $e -> getFile ( ) ;
}
?>
Try it yourself
$exception -> getFile ( )