Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70934 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60407 invoked from network); 30 Dec 2013 21:56:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2013 21:56:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:59331] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/35-33070-DEBE1C25 for ; Mon, 30 Dec 2013 16:55:59 -0500 Received: (qmail 28104 invoked from network); 30 Dec 2013 22:55:54 +0100 Received: from heim-032-99.raab-heim.uni-linz.ac.at (HELO RoLaptop) (193.171.32.99) by ns73.kreativmedia.ch with (AES128-SHA encrypted) SMTP; 30 Dec 2013 22:55:54 +0100 To: "'Yasuo Ohgaki'" , "'Stas Malyshev'" Cc: "'Nikita Popov'" , References: <52C1DB86.1030909@sugarcrm.com> <52C1E61B.8050404@sugarcrm.com> In-Reply-To: Date: Mon, 30 Dec 2013 22:55:53 +0100 Message-ID: <004501cf05a9$e980fbb0$bc82f310$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIg5nzQl97lsIkrspX5/TqL/A83SwImMaf8AovkCooCBzjS8gJPwDngAe0eDsQBovraJwIZV4w4mVPw/cA= Content-Language: de-ch Subject: RE: [PHP-DEV] GMP object and is_scalar() From: php@tutteli.ch ("Robert Stoll") > -----Original Message----- > From: yohgaki@gmail.com [mailto:yohgaki@gmail.com] On Behalf Of Yasuo Ohgaki > Sent: Monday, December 30, 2013 10:46 PM > To: Stas Malyshev > Cc: Nikita Popov; internals@lists.php.net > Subject: Re: [PHP-DEV] GMP object and is_scalar() > > 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 I think __toScalar is way to wage, what will __toScalar() return? a bool, an int, a float or a string?