What is faster: many ifs, or else if?

后端 未结 11 1810
夕颜
夕颜 2020-12-29 22:35

I\'m iterating through an array and sorting it by values into days of the week.

In order to do it I\'m using many if statements. Does it make any differ

11条回答
  •  情歌与酒
    2020-12-29 23:20

    You can have a look at phpbench

    But to be honest if you want to optimize at this level, you might want to learn something else than php.

    alt text

提交回复
热议问题