我有这段代码:
try
{
foreach($obj_c->getGalleries($db_conn1) as $gallery)
{
$gallery->Save($db_conn1);
}
$k = 0;
$testing_the_exception = 15/$k;
//settin status to 1...
$obj_c->set_exec_status(3, 1, $db_conn1);
}
catch (Exception $e)
{
//settin status to 3...
$obj_c->set_exec_status(3, 3, $db_conn1);
echo 'Caught exception: ', $e->getMessage(), "\n";
}
unset($obj_c);
事实是它应该进入 catch 部分,因为除以零异常,但它只是弹出警告并继续将状态设置为 1。这是预期的行为吗?提前非常感谢。