Exception::getMessage

(PHP 5, PHP 7)

Exception::getMessage锟斤拷取锟届常锟斤拷息锟斤拷锟斤拷

说锟斤拷

final public Exception::getMessage ( void ) : string

锟斤拷锟斤拷锟届常锟斤拷息锟斤拷锟捷★拷

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟酵碉拷锟届常锟斤拷息锟斤拷锟捷★拷

锟斤拷锟斤拷

Example #1 Exception::getMessage()示锟斤拷

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

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

Some error message

锟轿硷拷

  • Throwable::getMessage()