Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70944 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7739 invoked from network); 31 Dec 2013 11:48:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2013 11:48:23 -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.214.179 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.179 mail-ob0-f179.google.com Received: from [209.85.214.179] ([209.85.214.179:38651] helo=mail-ob0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/B1-27679-60FA2C25 for ; Tue, 31 Dec 2013 06:48:23 -0500 Received: by mail-ob0-f179.google.com with SMTP id wm4so12579452obc.38 for ; Tue, 31 Dec 2013 03:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=h7WuRQYtyUFdvBh2DSEW1H6mxijs3NhIJsdEbmAcQkM=; b=yxAtQSvt4hek98eKvVjNS+hIFVif9Go4+x5ECw8EEAXzfiPIz8LVENWNa3pGTk2g+R 3lxEFzLdJFWuQr57HIiCUIklZB7UEKBB9uHXI24IbyLgrg18eVhmWr1KDkk7KHclYnL6 75Mmp2lDE/seilkmhCzKqmBkEXjgZrickPP2LSVt1A+XB+m71R1pIt1rRa/GjNUnlvVF r2w2jC5QuTfvRbEin3FmINi10FiBNOheXo4obU0LlzhQXquizwAbyQvmueTV0w5A021y qGncVGokzcHmamzjAOjNNmEBoMVq6427o6Jk5M3EZ3iQgVHsfy28WH/aSEWRCDJQlEB3 m5Dg== MIME-Version: 1.0 X-Received: by 10.60.93.229 with SMTP id cx5mr193297oeb.82.1388490500119; Tue, 31 Dec 2013 03:48:20 -0800 (PST) Received: by 10.182.54.112 with HTTP; Tue, 31 Dec 2013 03:48:20 -0800 (PST) In-Reply-To: References: Date: Tue, 31 Dec 2013 12:48:20 +0100 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b33d3ce08a04c04eed32355 Subject: Re: [PHP-DEV] [RFC][DRAFT] GMP number as PHP number From: nikita.ppv@gmail.com (Nikita Popov) --047d7b33d3ce08a04c04eed32355 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 31, 2013 at 12:44 AM, Yasuo Ohgaki wrote: > Hi all, > > There has been GMP number discussion and made draft RFC for it. > Please comment so that I can add more to the RFC. > > Thank you. > RE empty(): There is nothing special that needs to be done to implement this. To support empty() one simply has to implement the IS_BOOL cast. The reason I haven't implemented it in the first place is the common C++ programmer wisdom that you should never, ever overload the bool operator without using the safe bool idiom or an explicit operator (both not available in PHP, of course). But given that I already have GMP to string, double and int conversions implemented, it doesn't seem entirely unreasonable to also allow checking for GMP(0) via !$gmpNum as well. If the general opinion is that we want this behavior, I can add it. Nikita --047d7b33d3ce08a04c04eed32355--