On Sun, May 12, 2013 at 9:57 PM, Sara Golemon <poll...@php.net> wrote:

> Are we ignoring the ZEND_IS_SMALLER issue?
>
Not ignoring it :) It's mentioned in one sentence: "The operators >, >=, [...]
are indirectly supported by the following compiler transformations: [...]"

if ($gmp > 123) { ... }
>
> There's no ZEND_IS_GREATER opcode, so it gets quietly turned into:
>
> if (123 < $gmp) { ... }
>
> Which will be confusing.
>

Why would this be confusing? I'd agree if this happened in userland (people
could wonder why the operators are swapped), but internally we are already
dealing with this anyway. E.g. when you implement compare_objects you have
to be aware of this (to understand stuff like the return 1 trick).


> I dealt with this in operator by having the user apply a patch before
> building:
> https://github.com/php/pecl-php-operator/blob/master/compare-greater-5.1.2.diff
>
> If we're going to bake this into ZE, then we should just add
> ZEND_IS_GREATER(_OR_EQUAL) opcode.
>

Not sure this is really necessary, but I have no problem with doing that
either.

Nikita

Reply via email to