php try … else

后端 未结 6 1511
余生分开走
余生分开走 2021-01-07 18:50

Is there something similar in PHP to the try ... else in Python?

I need to know if the try block executed correctly as when the block executed correctly

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 19:22

    try {
        $clean = false;
        ...
        $clean = true;
    } catch (...) { ... }
    
    if (!$clean) {
        //...
    }
    

    That's the best you can do.

提交回复
热议问题