duanliang5051 2011-04-26 08:18
浏览 55
已采纳

elseif和5000行代码。 elseif是否与处理时间有所不同

Hello to everyone on this WONDERFUL site!!!!

I am in the process of coding a php script and it is expected to have over 5000 lines of code when finished. Each 100 lines or so will be broken up by esleif's so only about 100 lines will need to be processed when it runs.

My question is does php precess every line or will it literally skip if the conditions are not met? I want to know if it makes a difference in processing time. Is one large file broken up with elseif's the same as multiple files?

Thank you all in advance!

  • 写回答

3条回答 默认 最新

  • doudiewen9435 2011-04-26 08:30
    关注

    PHP will have to look at all code before it starts. Having it in a big file might be quicker, but one helluva kahuna to maintain.

    • Consider control statements like switch if you're writing lots of if..else.. stuff.
    • Consider caching plugins to speed stuff up
    • Consider code redundancy, using functions and modularising code. From your description, I've an awful vision of a main() with 5000 lines, which will be a nightmare to pick up in 6 months' time
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

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