Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53859 invoked from network); 30 Dec 2013 21:21:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2013 21:21:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.43 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.43 mail-la0-f43.google.com Received: from [209.85.215.43] ([209.85.215.43:60661] helo=mail-la0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/C3-33070-DB3E1C25 for ; Mon, 30 Dec 2013 16:21:01 -0500 Received: by mail-la0-f43.google.com with SMTP id n7so5795002lam.16 for ; Mon, 30 Dec 2013 13:20:58 -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=DgKai8QGn37C9tc/oUyUfN8zCawm5fXew683BRqI6SM=; b=gmg65CzFwYfjrg9Kiy2C1xLHVu2/5aqpG6Rdm+r+2Y3NjiyicsdMGNXnP4pzBpFWOP +qt+bQg92uYQwKQ1DzFjP5MumDWm/K1YQVo+W3RGUbCKv21v7E8gkcYDxteZT0HQ1hvs tKhb1Kp9HAHcSsZL1mCgMpdl5zyJMh/8yr6hTstlfsQX5+/ebwAXT0YZojn72a6dq8hb 8AqIE2O2E4AtprN6Bco5fFYq5lgHjbJx0VnP50hess70DYYjHIwji0Ac2vAFIM1fhwmh BM5VCTtMlkWYnI9k+jScQT8QAi9j6kJKKa8ymI3h/enhuwyajOvEsX/zeeNn0QV/3t6p 0pBA== X-Received: by 10.112.63.104 with SMTP id f8mr793762lbs.79.1388438458351; Mon, 30 Dec 2013 13:20:58 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.6.68 with HTTP; Mon, 30 Dec 2013 13:20:18 -0800 (PST) In-Reply-To: <52C1DB86.1030909@sugarcrm.com> References: <52C1DB86.1030909@sugarcrm.com> Date: Tue, 31 Dec 2013 06:20:18 +0900 X-Google-Sender-Auth: RDM3ONPYLWygxp8IwBY33syGhd0 Message-ID: To: Stas Malyshev Cc: Nikita Popov , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3bc4a1a442e04eec7051a Subject: Re: [PHP-DEV] GMP object and is_scalar() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3bc4a1a442e04eec7051a Content-Type: text/plain; charset=UTF-8 Hi Stas, On Tue, Dec 31, 2013 at 5:45 AM, Stas Malyshev wrote: > > Since GMP object works just like numbers, this could cause bug that > > users assume it is "number" or "scalar". > > is_scalar checks if the value is a scalar. Objects and resources are not > scalars. If someone doesn't understand that, he should read manual page > of is_scalar before using it. I agree. Generally speaking, users should know this. I'm bringing up this as issue to discuss, since GMP numbers will be work like numbers from PHP 5.6. Most users will expect numbers are evaluated like other numbers(int/float), I suppose. It may be hard to distinguish normal numbers(int/float) and GMP numbers in large scripts, too. I can think of 3 options for now. - Treat GMP object as special object - Make scalar object - Make autoboxing like feature We have 4th option that leave it as it now, but it wouldn't be user friendly. Since this (GMP numbers work like normal numbers) is new feature, we may choose better option. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3bc4a1a442e04eec7051a--