array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'exception.getmessage.php', 1 => 'Exception::getMessage', 2 => 'Gets the Exception message', ), 'up' => array ( 0 => 'class.exception.php', 1 => 'Exception', ), 'prev' => array ( 0 => 'exception.construct.php', 1 => 'Exception::__construct', ), 'next' => array ( 0 => 'exception.getprevious.php', 1 => 'Exception::getPrevious', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'language/predefined/exception/getmessage.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Exception::getMessage

(PHP 5, PHP 7, PHP 8)

Exception::getMessageGets the Exception message

Опис

final public Exception::getMessage(): string

Returns the Exception message.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns the Exception message as a string.

Приклади

Приклад #1 Exception::getMessage() example

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

Поданий вище приклад виведе щось схоже на:

Some error message

Прогляньте також