Error::getMessage
(PHP 7, PHP 8)
Error::getMessage — 获取错误信息
说明
final public Error::getMessage(): string
返回错误信息。
参数
此函数没有参数。
返回值
返回字符串错误信息。
范例
示例 #1 Error::getMessage() 例子
<?php
try {
throw new Error("Some error message");
} catch(Error $e) {
echo $e->getMessage();
}
?>
以上例程的输出类似于:
Some error message

User Contributed Notes
There are no user contributed notes for this page.