PHP performance

前端 未结 13 2220
庸人自扰
庸人自扰 2020-12-28 19:03

What can I do to increase the performance/speed of my PHP scripts without installing software on my servers?

13条回答
  •  情歌与酒
    2020-12-28 19:40

    The ones I can think of...

    • Loop invariants are always a good one to watch.

    • Write E_STRICT and E_NOTICE compliant code, particularly if you are logging errors.

    • Avoid the @ operator.

    • Absolute paths for requires and includes.

    • Use strpos, str_replace etc. instead of regular expressions whenever possible.

    Then there's a bunch of other methods that might work, but probably wont give you much benefit.

提交回复
热议问题