PHP “Exception not found”

后端 未结 3 1872
半阙折子戏
半阙折子戏 2021-02-12 22:15

I have a somehow funny issue. While trying to understand why a certain website returns http code 500 to browser, I found the message

PHP Fatal error:  Class \'MZ         


        
3条回答
  •  耶瑟儿~
    2021-02-12 23:13

    Extending @hakre answer you can simplify its usage with:

    use \Exception as Exception;
    

    That way you can throw exceptions without remembering the backslash like:

    throw new Exception('This bundle needs the cURL PHP extension.');
    

提交回复
热议问题