* Thus wrote Chris Shiflett ([EMAIL PROTECTED]): > --- "Ford, Mike [LSS]" <[EMAIL PROTECTED]>" <[EMAIL PROTECTED]> wrote: > > Firstly, "or", as a Boolean operator requires two operands, both of > > which must have an actual value. > > [snip] > > > statements don't have a value (and can't even be coerced to have > > one), so "return" can't be valid as one of the operands to "or". > > Based on yesterday's discussion, this seems to be a very common misconception. > I will try to clear it up.
To add this, the 'include' family also accepts this construct: condition or include(file); Which also violates the rule that statments (constructs) dont have return values. I have a feeling die() was special cased to inherit the popular perl method of using: condition or die(); > > 1. If you find some Coke or Pepsi, buy some. > > This suggests that either Coke or Pepsi will suffice. In PHP: > > if ($type == 'coke' || $type == 'pepsi') > { > buy_some(); > } So now we're at $coke or $pepsi and buy_some() :) Curt -- "My PHP key is worn out" PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php