Error
PHP Manual

Error::__toString

(No version information available, might only be in Git)

Error::__toStringString representation of the error

Beschreibung

public string Error::__toString ( void )

Returns the string representation of the error.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns the string representation of the error.

Beispiele

Beispiel #1 Error::__toString() example

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

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

Siehe auch


Error
PHP Manual