dovzrfr0506 2012-03-28 07:17
浏览 64
已采纳

停止php执行而不只是在codeigniter中的php脚本

I am using Codeigniter for a project and i usually call a series of models (let's say controllerA -> modelA -> modelB -> modelC) for some work. I want the php to stop executing when it reaches some exception where i invoke the exit() command. Now, if the command exit() is invoked in modelB, will it stop execution of only the script of modelB and continue executing rest of the modelA? Or will it stop the entire execution flow.

I really don't know how to put this question here. The question looks quite messy. Please let me know should i need to revise the question itself.

  • 写回答

5条回答 默认 最新

  • duancashi1362 2012-03-28 08:18
    关注

    Yes, exit stops all script execution immediately, regardless where you call it.

    The opposite is return which only stops execution of the current function (or current file when used at global level in an included file)

    Read more here: https://stackoverflow.com/a/9853554/43959

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器