optimization - PHP if OR is the second part checked on true? -
i know must simple question, know in php in statement this
if ($a && $b) { }
if $a false php doesn't check $b
well same thing true or so
if ($a || $b) { }
if $a true, still check $b
i know elementary stuff, can't find answer anywhere... thanks
see example 1 on logical operators page in manual.
// -------------------- // foo() never called operators short-circuit $a = (false && foo()); $b = (true || foo()); $c = (false , foo()); $d = (true or foo());
Comments
Post a Comment