PHP short circuit lazy evaluation, where is it in the php.net manual?

后端 未结 2 1823
南笙
南笙 2020-11-29 10:00

Sorry if this sounds like a really silly question.

But I Googled the web and also Googled specifically both the php.net site and the stackoverflow.com site.

2条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 10:38

    This is not an uncommon feature of expression evaluation. The PHP manual page on logical operators makes a passing reference to it in one of the illustrative examples though.

    Short circuit evaluation is a commonly exploited idiom, and you can rely on its continued support in the language, otherwise vast amounts of code would break!

提交回复
热议问题