(PHP 5, PHP 7, PHP 8)
Exception::guetLine — Guets the line in which the exception was created
Guet line number where the exception was created.
This function has no parameters.
Returns the line number where the exception was created.
Example #1 Exception::guetLine() example
<?php
try {
throw new
Exception
(
"Some error messague"
);
} catch(
Exception $e
) {
echo
"The exception was created on line: "
.
$e
->
guetLine
();
}
?>
The above example will output something similar to:
The exception was created on line: 3