Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70933 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58594 invoked from network); 30 Dec 2013 21:46:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2013 21:46:52 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.51 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.51 mail-la0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:36274] helo=mail-la0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/D4-33070-AC9E1C25 for ; Mon, 30 Dec 2013 16:46:51 -0500 Received: by mail-la0-f51.google.com with SMTP id ec20so5916266lab.10 for ; Mon, 30 Dec 2013 13:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=naHYNUx1P+jyhwEW55q9e5cgzleHz2SxgvL/8Ur4oE8=; b=hmnbPOu+xMrkOIKbXKcd51bKLmkclX3vMnm1qDds5iEs7V85tFYbJ22LsJfpczgoFk iynpuCD+kG5yE1Iiwly/a2KytyP5yxqT1aHfZI5ZsOA1ki1hzHAQY38TDXXZKRTgvQ1e nengyCPC8cfkRfqb22PWot0uMk3BBpq4BGeNi2VwEu/P3agn/hNAd5jZezDXlCnwkQ+B 8uqrOV0JP87zcv7XjmdCkyTYNMK25d/nWyNAm5ZeLyFmNNXuARGsMez5U8Kk1ynVSGIT 1Vp/XV6rC4gfWGglUDbsO8XOiuBDaIqOOuKGXLL1dkYnyw7fcOIf780Ln6S3+WzyROta wZKA== X-Received: by 10.152.120.7 with SMTP id ky7mr875493lab.83.1388440007703; Mon, 30 Dec 2013 13:46:47 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.6.68 with HTTP; Mon, 30 Dec 2013 13:46:07 -0800 (PST) In-Reply-To: References: <52C1DB86.1030909@sugarcrm.com> <52C1E61B.8050404@sugarcrm.com> Date: Tue, 31 Dec 2013 06:46:07 +0900 X-Google-Sender-Auth: qJL6AwOXq3gqdDs8JEfeyMgj5Rk Message-ID: To: Stas Malyshev Cc: Nikita Popov , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0117690d7380c704eec7610a Subject: Re: [PHP-DEV] GMP object and is_scalar() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0117690d7380c704eec7610a Content-Type: text/plain; charset=UTF-8 Hi Stas, On Tue, Dec 31, 2013 at 6:35 AM, Yasuo Ohgaki wrote: > On Tue, Dec 31, 2013 at 6:31 AM, Stas Malyshev wrote: > >> > Since this (GMP numbers work like normal numbers) is new feature, we >> > may choose better option. >> >> I think you're taking it way too far. GMP numbers may support some >> functions that scalars support, but that does not mean every function - >> especially functions with are *specifically designed* to distinguish >> scalars from objects - would do the same thing for them as for scalars. >> If you're interested in their "numeric" properties - i.e. adding them, >> multiplying them, etc. - fine, they work that way. But if you "pop the >> hood" and look inside - no, they should not be scalars inside, because >> they are not. > > > I agree with your opinion in general. > > How about introduce scalar object that is evaluated as scalar? > It would be useful in user land also. > http://www.php.net/manual/en/language.oop5.magic.php Something like __toScalar(), may be? -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0117690d7380c704eec7610a--