Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70939 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68617 invoked from network); 30 Dec 2013 22:50:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2013 22:50:37 -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.217.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:37648] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/F6-33070-BB8F1C25 for ; Mon, 30 Dec 2013 17:50:36 -0500 Received: by mail-lb0-f170.google.com with SMTP id c11so5891120lbj.15 for ; Mon, 30 Dec 2013 14:50:32 -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=rImyrR+zYZUVAmMBXxBs9XhGfIQO46zVlhyupUapUqM=; b=JFni2IjwoVX/kuDwLY/NYyB0Vt41Y74TT4Q1lsl1pVUg+J725jIpXZ4In6wEPIKWEK ++8Ts7MlUvPWVV7Fhe0stmr1ENFu74tWjcqVBuf3aj1SOYvpQ1Q7xaN4qS2qNbF6VAbu P7pwnb1FzGDCzVBO8Uz/AurG5xZkPT6gu2LwTh/wo02dYkDIU57Cq4Zwus0gkBXvnqjW 6Qs/d/vHeVcDA4Y6ADiTYIORtWm8SfG7iaaWaZIBXx3oxYF40bNxIjt3lS8nQNJiKLUU J+ld2GH7pg66k3wNAl0nVzv8Qv4ISda8PajS5knxhTHb62hrEJ8FS151gcldu6VpWPXX vDDA== X-Received: by 10.152.180.66 with SMTP id dm2mr73589lac.88.1388443832032; Mon, 30 Dec 2013 14:50:32 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.6.68 with HTTP; Mon, 30 Dec 2013 14:49:51 -0800 (PST) In-Reply-To: <52C1F1A7.2000509@sugarcrm.com> References: <52C1DB86.1030909@sugarcrm.com> <52C1E61B.8050404@sugarcrm.com> <004501cf05a9$e980fbb0$bc82f310$@tutteli.ch> <52C1EDC7.5060807@sugarcrm.com> <52C1F1A7.2000509@sugarcrm.com> Date: Tue, 31 Dec 2013 07:49:51 +0900 X-Google-Sender-Auth: szK5dyZIbeDOxJqCcEZnF4FkcCk Message-ID: To: Stas Malyshev Cc: Nikita Popov , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1134589666219b04eec84581 Subject: Re: [PHP-DEV] GMP object and is_scalar() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1134589666219b04eec84581 Content-Type: text/plain; charset=UTF-8 Hi Stas, On Tue, Dec 31, 2013 at 7:20 AM, Stas Malyshev wrote: > > Should it? PHP is weakly typed language. > > That doesn't mean types do not exist. That means values can be converted > from type to type, but there's no type "scalar" - it is just a group > name of a set of types. > Agreed on that scalar is name of types which has single value. > One thing clear to me is users expects GMP numbers behave like > > scalar numbers most likely. > > I don't think users expect anything like that, I don't see legitimate > use case why users would expect is_scalar return true on GMP object. If > the user is advanced enough to use is_scalar he should understand what > that function does. Or user some other function that is more fit for > their goals. > I agree users who know PHP and GMP well would not expect GMP object is to evaluated as scalar. I suppose average users would expect/want GMP number as PHP number also. > Yet another option for PHP 5.6 is to note GMP numbers as > > EXPERIMENTAL. > > GMP is in PHP for a long time, why would it suddenly become experimental? Sorry, I meant GMP number arithmetic with normal operators/math functions/ type evaluation functions is better to be considered as EXPERIMENTAL. It lacks GMP float support and many function won't work as it should be. (If we consider GMP number as "number" in PHP) It's safe to note GMP number arithmetic as EXPERIMENTAL and resolve issues. IMHO. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1134589666219b04eec84581--