Getting Unexpected '<' in simple less than greater than comparison

Posted by Elizabeth Buckwalter on Stack Overflow See other posts from Stack Overflow or by Elizabeth Buckwalter
Published on 2010-03-30T20:50:45Z Indexed on 2010/03/30 20:53 UTC
Read the original article Hit count: 416

Filed under:

I feel very very very silly posting this, but I can't find the answer. I've searched google and here.

// originally values in a multi dimensional array, but used simple values 
// to rule out errors.
$somenumber = 1; $anotherone=5;
if ($somenumber < $res->shares < $anotherone ) {
     blah
}

Get the error: Parse error: syntax error, unexpected '<'

Seems pretty simple and straight forward. Is there some weird thing that you can't compare multiple values? Do I have to explicitly type?

It works in Perl. Which of course means that it has to work like this in everything else. ;)

© Stack Overflow or respective owner

Related posts about php