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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -