php: try-catch not catching all exceptions

后端 未结 4 1052
-上瘾入骨i
-上瘾入骨i 2020-12-23 17:34

I\'m trying to do the following:

try {
    // just an example
    $time      = \'wrong datatype\';
    $timestamp = date(\"Y-m-d H:i:s\", $time);
} catch (Ex         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 17:54

    catch(Throwable $e) works catch ( Throwable $e){ $msg = $e-> getMessage(); }

提交回复
热议问题