Does having a lot of if statements degrade rendering speed of php?

前端 未结 6 1085
礼貌的吻别
礼貌的吻别 2021-01-02 04:12

I was wondering if complicated if/else structures in my PHP code could be a bad design decision. Does having a lot of if statements make PHP run slow, site load slower etc?<

6条回答
  •  遥遥无期
    2021-01-02 05:01

    Very complicated if/else structures indicate a bad design in most cases. You can better focus on improving a bad design than optimization, premature optimization is the root of all evil!.

    If you give an example of the type of code you are talking about, it will maybe be possible to give a more detailed answer.

提交回复
热议问题