update page now
Laravel Live Japan

Exception::getLine

(PHP 5, PHP 7, PHP 8)

Exception::getLineGibt die Zeile zurück, in der die Exception erzeugt wurde

Beschreibung

final public Exception::getLine(): int

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

Parameter-Liste

Diese Funktion besitzt 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 created on line: " . $e->getLine();
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

The exception was created on line: 3

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant