Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70909 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56836 invoked from network); 29 Dec 2013 19:33:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Dec 2013 19:33:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.46 as permitted sender) X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 209.85.160.46 mail-pb0-f46.google.com Received: from [209.85.160.46] ([209.85.160.46:64459] helo=mail-pb0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/60-54477-A1970C25 for ; Sun, 29 Dec 2013 14:33:47 -0500 Received: by mail-pb0-f46.google.com with SMTP id md12so10828058pbc.19 for ; Sun, 29 Dec 2013 11:33:44 -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=2K4DPbC9NbXyK1kepoq9qhhCITsG2vSH9+iwGwUr9Cs=; b=dolR+2CUpOh7HwVV++QgudWFadijPy19/GZ9A60i6yKacNtH9d4ZSQbJOkUasSsTpg zULKFSW7NZfNzGSRCBJD9/DC227dLZPgJh8POe0X9n0xbl4EFAQNYghKlYC5A2sTB1zn psFZFzkCGzXS72fXUW/oF/DOS3XLHBg2HI9gGTT3bh1u0MEQ1dyXi9gVhTCtnDPiGuBi meD6LrwcfYGFmw7N4TtBB0R6BYCGeFaWLWJlwP/h0itUFvBQx3uptvXT0Q2GSaZX9XAW gsao69iDePqeyOEUHoLmupAjGWLtQQwgjxCjUH+yd0XksTZKfUB0AJpSVDDAg2KVe5dS HF8g== MIME-Version: 1.0 X-Received: by 10.68.253.7 with SMTP id zw7mr63760725pbc.83.1388345623990; Sun, 29 Dec 2013 11:33:43 -0800 (PST) Received: by 10.68.183.4 with HTTP; Sun, 29 Dec 2013 11:33:43 -0800 (PST) In-Reply-To: References: Date: Sun, 29 Dec 2013 11:33:43 -0800 Message-ID: To: Nikita Popov Cc: Yasuo Ohgaki , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] GMP object and is_scalar() From: hannes.magnusson@gmail.com (Hannes Magnusson) On Sun, Dec 29, 2013 at 11:26 AM, Hannes Magnusson wrote: > On Sun, Dec 29, 2013 at 9:54 AM, Nikita Popov wrote: >> On Sun, Dec 29, 2013 at 9:09 AM, Yasuo Ohgaki wrote: >> >>> Hi all, >>> >>> GMP object is object. Therefore, is_scalar() returns false for GMP >>> objects. >>> >>> [yohgaki@dev php-src]$ ./php-bin -r '$v = gmp_init("0"); >>> var_dump(gettype($v));' >>> string(6) "object" >>> [yohgaki@dev php-src]$ ./php-bin -r '$v = gmp_init("0"); >>> var_dump(is_scalar($v));' >>> bool(false) >>> >>> This is correct behavior, but this behavior is debatable, IMO. >>> >>> Any comments? >>> >> >> Sorry, I don't understand what you're saying. Why would is_scalar return >> true for an **object**? > > > Its not even an object, its a resource. > > I think you are completely off path here Yasuo, same with your empty() thread. > That just doesn't make sense. Waiiit a minute. It is a object in current master? That will break code that makes sure gmp_init() worked by doing is_resource() on the return value. -Hannes