in reply to Re: logical AND "&&"
in thread logical AND "&&"

I heard you could write
if($a==1&&$b<2&&$d<4&&$e>=6){

Replies are listed 'Best First'.
Re^3: logical AND "&&"
by ikegami (Patriarch) on Jan 31, 2010 at 17:25 UTC

    It wasn't clear if he knew the parens weren't necessary. Also, it wasn't clear if he knew that

    if (($a == 1 && $b < 2) && ($d < 4 && $e >= 6)) {
    is the same as
    if ($a == 1 && ($b < 2 && ($d < 4 && ($e >= 6))) {

    Those are the two things I pointed out in my post. I wasn't trying to say that parens are bad. In this case, though, spacing can also provide clear disambiguation

    if ($a==1 && $b<2 && $d<4 && $e>=6) {