PHP.nl

Error::getLine

Error::getLine

Gets the line in which the error occurred

int **Error::getLine**

Get line number where the error occurred.

Returns the line number where the error occurred.

Voorbeeld: example

<?php
try {
    throw new Error("Some error message");
} catch(Error $e) {
    echo "The error was created on line: " . $e->getLine();
}
?>
The error was created on line: 3

Throwable::getLine

Documentatie