<?php try { dsss(); } catch (Exception $e) { echo $e->getMessage(); // die(); // 终止异常 } function dsss() { try { $num1 = 3; $num2 = 0; if ($num2 == 0) { throw new Exception("11321"); } else { $res = $num1 / $num2; } } catch (Exception $e) { throw $e; } } ?>
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/18969.html