hope that explains it a bit furthur
Martin
-Original Message-
From: jv [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 29, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Help with Logical 'OR'
Thanks Matt, Jeff, and Sam
(BTW Sam, for some reason your post didn
Thanks Matt, Jeff, and Sam
(BTW Sam, for some reason your post didn't come to me on the list through
regular email- I found it when I did a search in the archives at php.net. I
'm pretty sureI didn't delete it. I mention this because I'm sure the list
server hiccups sometimes and I'd hate to offen
For sake of efficiency, many languages will do what is called "Short
Circuit" in a situation like this. Let's look at a simple truth table for
an OR using two conditions (T=true, F=false):
T || T = T
T || F = T
F || T = T
F || F = F
In the first two cases, it is only necessary to evaluate the
With a logical OR statement, many languages will evaluate the first
statement, and if the first condition is true, then it will not evaluate
the second condition, because TRUE OR (anything) is TRUE. This saves the
program from executing any more code than it has to. If the first
condition is
4 matches
Mail list logo