Re: [PHP] Lazy evaluation? -=- The solution

2002-01-17 Thread TD - Sales International Holland B.V.
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Bogdan Stancescu
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread mike cullerton
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Bogdan Stancescu
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Jimmy
>> 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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Bogdan Stancescu
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!

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Miles Thompson
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread mike cullerton
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Miles Thompson
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

Re: [PHP] Lazy evaluation?

2002-01-16 Thread Jimmy
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