Try/Catch block in PHP not catching Exception

后端 未结 12 812
既然无缘
既然无缘 2020-12-04 13:45

I am trying to run this Example #1 from this page: http://php.net/manual/en/language.exceptions.php



        
12条回答
  •  我在风中等你
    2020-12-04 14:34

    \Exception doesn't work for me but I found a solution.

    I needed to replace try{}catch(Exception $e){} by try{}catch(Throwable $e){}.

    For more information : https://trowski.com/2015/06/24/throwable-exceptions-and-errors-in-php7/

提交回复
热议问题