On 11/11/2016 6:03 PM, David Walker wrote:
> I took a quick stab at implementing, and had something working for constant
> expressions, but handling something akin to:
> 
> $a = 2;
> if (1 < $a++ < 3) {
> ...
> }
> 
> Is a bit awkward in our expansions of : if (1 < $a++ && $a++ < 3).  Seems
> as if when processing the chain here, you'd need to see if the left node
> has a child, and somehow ensure you get the evaluated value somehow, to
> override the "left" node.  So logically expansion of the above would be  if
> (1 < $a++ && 3 < 3).  I think the same would have too somehow handle
> (either by syntax error or something) that if a non-numeric value creeps
> into a binary-op-compare we error like:  if (1 < (2==3) < 3).
> 
> Just some food for thought
> --
> Dave
> 

Nice :)

Personally I would make all of these situations parse errors. These are
hard to read and understand code constructs, why would we want to
support them in the first place?

-- 
Richard "Fleshgrinder" Fussenegger

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to