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