Exception::getMessage

(PHP 5, PHP 7)

Exception::getMessageGets the Exception message

Descrierea

final public Exception::getMessage ( void ) : string

Returns the Exception message.

Parametri

Această funcție nu are parametri.

Valorile întoarse

Returns the Exception message as a string.

Exemple

Example #1 Exception::getMessage() example

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

Exemplul de mai sus va afișa ceva similar cu:

Some error message

A se vedea și