Resume PHP to execution script after exception

前端 未结 4 1835
[愿得一人]
[愿得一人] 2021-01-04 07:01

I have a php script lets say during execution the scripts throws an exception. I want my PHP to resume from where it left off (where it had thrown the exception).

Sh

4条回答
  •  忘掉有多难
    2021-01-04 07:38

    You might be able to use the finally part of the try catch, if you will not get an exception in execution.

    try {
      // some crashing code
    } catch (Exception $e) {
      //some catch code
    } finally {
      //code that will run anyways.
    }
    

提交回复
热议问题