downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Exception::getTrace> <Exception::getFile
[edit] Last updated: Fri, 17 May 2013

view this page in

Exception::getLine

(PHP 5 >= 5.1.0)

Exception::getLineGibt die Zeile zurück, in der die Exception auftrat

Beschreibung

final public int Exception::getLine ( void )

Gibt die Zeile zurück, in der die Exception ausgelöst wurde.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Gibt die Zeile zurück, in der die Exception ausgelöst wurde.

Beispiele

Beispiel #1 Exception::getLine()-Beispiel

<?php
try {
    throw new 
Exception("Some error message");
} catch(
Exception $e) {
    echo 
"The exception was thrown on line: " $e->getLine();
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

The exception was thrown on line: 3



add a note add a note User Contributed Notes Exception::getLine - [1 notes]