PHP Doku:: Stringrepräsentation der Exception - exception.tostring.html

Verlauf / Chronik / History: (4) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchSprachreferenzVordefinierte ExceptionsExceptionException::__toString

Ein Service von Reinhard Neidl - Webprogrammierung.

Exception

<<Exception::getTraceAsString

Exception::__clone>>

Exception::__toString

(PHP 5 >= 5.1.0)

Exception::__toStringStringrepräsentation der Exception

Beschreibung

public string Exception::__toString ( void )

Gibt die Stringrepräsentation der Exception zurück.

Parameter-Liste

Diese Funktion hat 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}


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)