On Wednesday 16 January 2002 17:25, you wrote:
I'm sorry, I think I was confusing languages. PHP does do lazy evaluation. If
the left side is false the right side won't be evaluated. I've attached some
code, it ain't really neat & tidy but it's effective and will show you how it
works. Just ru
A few comments:
1. (and the most important) I was trying to be helpful, rather than arrogant as you
most probably perceived me.
2. My answer was directed to the original poster, not to you. However, it is true
that I was mistaken in posting the message as a reply to your message.
mike cullerton w
aha! see, i didn't understand the whole picture. so, let me see if i can
create another question. suppose
if (($a_good = ($a == 'a')) && ($b_good = ($b == 'b'))) blahblahblah();
are you saying, that $b_good should always have the result of ($b == 'b')
even if $a != 'a'? that's not what my test
LOL! He asked if PHP supports lazy evaluation, not buggy evaluation!
Bogdan
Miles Thompson wrote:
> SHWLHAP! (Sound of dead fish hitting me in the side of the head.)
>
> Of course - if the first condition is false, PHP doesn't bother to evaluate
> the second argument.
> I was thinking that if t
>> For "or" statements it does, but not && or xor.
Are you sure only "or" which do lazy evaluation?
as far as i remember, the last time I use "&&" operator it do
lazy evaluation.
And if you look at the online manual, some users also confirmed
that PHP implement lazy evaluation for logical operato
Dude, why don't you just check it out yourself? You'll never be 100%
certain by asking people around anyway, because most people have
distinct opinions on most issues. So then:
2) && ($lala=(1<2)) {};
if ($lala) {
echo("Me, lazy?! I check EVERYTHING!");
} else {
echo("OK, call me lazy!
SHWLHAP! (Sound of dead fish hitting me in the side of the head.)
Of course - if the first condition is false, PHP doesn't bother to evaluate
the second argument.
I was thinking that if the first condition is true I don't want evaluation
to stop there.
Miles
At 08:18 AM 1/16/2002 -0700, mike
on 1/16/02 5:57 AM, Miles Thompson at [EMAIL PROTECTED] wrote:
> For "or" statements it does, but not && or xor. I don't know about you, but
> I wouldn't want lazy evaluation on a conditional statement involving "and".
i'm new to all this stuff, so i'll bite. hopefully someone can explain what
i
For "or" statements it does, but not && or xor. I don't know about you, but
I wouldn't want lazy evaluation on a conditional statement involving "and".
The manual ref is
http://www.php.ca/manual/en/language.operators.logical.php and the
following page on operator precedence.
Have a great one
Hi Alexander,
> Does PHP support lazy evaluation? Meaning that if:
Yes, it does.
--
Jimmy
Got a dictionary? I want to know the meaning of life.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
10 matches
Mail list logo