function - PHP - if (condition) execution -
let's have this:
if(1 == 0 && do_stuff()) { ... } obviously 1 not 0, there's no point check other condition. php ever run do_stuff() ?
no - php uses lazy evaluation (sometimes called short-circuit evaluation), if first condition in logical , false, won't attempt evaluate of other conditions.
likewise, if doing or , first condition true wouldn't evaluate second.
Comments
Post a Comment