PHP 8.3.4 Released!

Exception::__toString

(PHP 5, PHP 7, PHP 8)

Exception::__toStringStringrepräsentation der Exception

Beschreibung

public Exception::__toString(): string

Gibt die Stringrepräsentation der Exception zurück.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Gibt die Stringrepräsentation der Exception zurück.

Beispiele

Beispiel #1 Exception::__toString()-Beispiel

<?php
try {
throw new
Exception("Some error message");
} catch(
Exception $e) {
echo
$e;
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

exception 'Exception' with message 'Some error message' in /home/bjori/tmp/ex.php:3
Stack trace:
#0 {main}

Siehe auch

add a note

User Contributed Notes

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