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

后端 未结 2 1792
南笙
南笙 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!

    0 讨论(0)
  • 2020-11-29 10:55

    Closest thing I can find to an 'official' mention of PHP's short-circuit implementation: http://php.net/manual/en/language.operators.logical.php

    0 讨论(0)
提交回复
热议问题