Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70908 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55267 invoked from network); 29 Dec 2013 19:26:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Dec 2013 19:26:29 -0000 Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.172 as permitted sender) X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 209.85.192.172 mail-pd0-f172.google.com Received: from [209.85.192.172] ([209.85.192.172:62476] helo=mail-pd0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/10-54477-46770C25 for ; Sun, 29 Dec 2013 14:26:29 -0500 Received: by mail-pd0-f172.google.com with SMTP id g10so10646291pdj.31 for ; Sun, 29 Dec 2013 11:26:26 -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=iXgE7a2GOcyaxKS6chjdid9/J4C7qUG/SdMrQhg/j34=; b=KJr02zfUJNjCGWZvkxtMzuBuggaKSiDXKLEtpV8Avm9HUo2BOl8sstqJXxGH6GbXKo 4WcPozRJatHsN9TpFwch/SosGt7MhnYngKbNSy+GDKPZCyJvO3JcsBYDOy50WN7oARta rC1ONm8mV55iDz6gGDGhM4YzWYO95cXJp+4zOTPaT6YD1yAUD47KpQDM9P2XcSolDXkM fryEppTk5vOVG+TYMeyEmCGAwGLCGE/DdUxoCTte+bCXCvHeBDPkDXf8o6gk9nDynfdP rtgxvUBStSuifdH5kv/Yx2PMptSWXRbdDzq/HOurrJKraQXUm/d/r/h17KVrBLOxRKvB TD4Q== MIME-Version: 1.0 X-Received: by 10.68.91.3 with SMTP id ca3mr63868775pbb.20.1388345186456; Sun, 29 Dec 2013 11:26:26 -0800 (PST) Received: by 10.68.183.4 with HTTP; Sun, 29 Dec 2013 11:26:26 -0800 (PST) In-Reply-To: References: Date: Sun, 29 Dec 2013 11:26:26 -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 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. -Hannes