請問一下啊我直接寫的throw new Exception('出錯');
請問一下啊我直接寫的throw new Exception('出錯'); 直接報Fatal error: Uncaught exception 'Exception' with message '出錯啦' in C:\xampp\htdocs\text\Index.php:9 Stack trace: #0 {main} thrown in C:\xampp\htdocs\text\Index.php on line 這種錯誤???必須加上trycatch
2019-02-15
throw new Exception
要配合
try{
throw new Exception();
}catch (Exception $e){
? ? ? ? ? ? return $e->getMessage();
?}