Re: [PHP] syntax for two comparison operators

2005-08-25 Thread Jordan Miller
Good to know about expression evaluation. Writing the expression(s) like that (left-to-right and right-to-left) solves my dilemma... thanks! Jordan On Aug 25, 2005, at 2:44 AM, Richard Lynch wrote: I personally would use: ((2 < $x) && ($x <= 4)) -- PHP General Mailing List (http://www.

Re: [PHP] syntax for two comparison operators

2005-08-25 Thread Richard Lynch
On Wed, August 24, 2005 6:10 pm, Jordan Miller wrote: > Is there a technical reason why PHP does not allow comparison > operator expressions like the following: > > if (2 < $x <= 4) {} 2 < $x <= 4 is a valid expression already. 2 < $x is evaluated first, and returns true/false true/false is comp

Re: [PHP] syntax for two comparison operators

2005-08-24 Thread Philip Hallstrom
Is there a technical reason why PHP does not allow comparison operator expressions like the following: if (2 < $x <= 4) {} I prefer this concise way as it is common for mathematics expressions, and much easier to grasp physically on first glance. From what I can tell, this expression can cur