Exception::getMessage

(PHP 5, PHP 7)

Exception::getMessageZwraca wiadomość wyjątku

Opis

final public Exception::getMessage ( void ) : string

Zwraca wiadomość wyjątku.

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

Zwraca wiadomość wyjątku jako łańcuch znaków.

Przykłady

Przykład #1 Przykład użycia Exception::getMessage()

<?php
try {
    throw new 
Exception("Jakaś wiadomość wyjątku");
} catch(
Exception $e) {
    echo 
$e->getMessage();
}
?>

Powyższy przykład wyświetli coś podobnego do:

Jakaś wiadomość wyjątku

Zobacz też:

add a note add a note

User Contributed Notes

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