Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67408 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6631 invoked from network); 12 May 2013 20:07:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2013 20:07:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.51 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.51 mail-oa0-f51.google.com Received: from [209.85.219.51] ([209.85.219.51:34800] helo=mail-oa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/E5-55400-096FF815 for ; Sun, 12 May 2013 16:07:45 -0400 Received: by mail-oa0-f51.google.com with SMTP id f4so6698719oah.24 for ; Sun, 12 May 2013 13:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=x5ESgbRtZ4yw5ByN73mhx8wMaKzyEw8TabdSb1GqyuU=; b=CIngPD4SShc/7fmKQ7ular5hkRKuiKk0fA3dBaApidM9e59LNDYLQJ6HHOMWKxAQxK g6c901GKHmdYYnmErWJZ3hX86axhT1Q1ro0r6iMMBtlJLMC6ZfXLmCLjZhbOA2YodEYg f+9KvSMqc2j2jH5Rp4kEqatVZVOza/3D65UW53a62KeNDq3AE026fIBhNG/bHM0dOSd8 14ephccnZEh18bDMLPP92Z5v9nsqqHqBHwnIRPmCcdIZp4aVHXIP103H7erzrbpV72V1 sFsLsH4/95rcF7ThGP7fyMCA5Ic8z/ZFWr5ThEQndvkEcuC8IGG73fw81u6kEwqrW6rB 1unw== MIME-Version: 1.0 X-Received: by 10.60.125.232 with SMTP id mt8mr5353479oeb.33.1368389262271; Sun, 12 May 2013 13:07:42 -0700 (PDT) Received: by 10.182.49.136 with HTTP; Sun, 12 May 2013 13:07:42 -0700 (PDT) In-Reply-To: References: <518FD653.6070705@daylessday.org> Date: Sun, 12 May 2013 22:07:42 +0200 Message-ID: To: Sara Golemon Cc: Antony Dovgal , PHP internals Content-Type: multipart/alternative; boundary=047d7b41408ee4d49f04dc8af3da Subject: Re: [PHP-DEV] [RFC] Internal operator overloading and GMP improvements From: nikita.ppv@gmail.com (Nikita Popov) --047d7b41408ee4d49f04dc8af3da Content-Type: text/plain; charset=ISO-8859-1 On Sun, May 12, 2013 at 9:57 PM, Sara Golemon 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 --047d7b41408ee4d49f04dc8af3da--