Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50166 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99971 invoked from network); 12 Nov 2010 08:23:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Nov 2010 08:23:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 209.85.161.42 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:52960] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/36-09545-B69FCDC4 for ; Fri, 12 Nov 2010 03:23:07 -0500 Received: by fxm8 with SMTP id 8so521108fxm.29 for ; Fri, 12 Nov 2010 00:23:04 -0800 (PST) Received: by 10.223.123.142 with SMTP id p14mr1119409far.122.1289550184305; Fri, 12 Nov 2010 00:23:04 -0800 (PST) Received: from pc ([83.228.56.37]) by mx.google.com with ESMTPS id 3sm1238338fav.12.2010.11.12.00.23.02 (version=SSLv3 cipher=RC4-MD5); Fri, 12 Nov 2010 00:23:03 -0800 (PST) Message-ID: To: "Christian Schneider" , "PHP internals" References: <3667608E-11C3-43B8-B652-CDEF46F87CE5@cschneid.com> Date: Fri, 12 Nov 2010 10:22:57 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Subject: Re: [PHP-DEV] Re: Supporting Binary Notation for Integers From: sv_forums@fmethod.com ("Stan Vass") > Just one little note: If I'm not mistaken this would introduce a subtle BC > break when doing the comparison "0b1" == 1 which is false > > now but > would return true afterwards, right? Likewise is_numeric("0b1") would > suddenly return true. > > Is it worth the (possible) WTF for something hardly ever used? > > - Chris With regards to parsing numeric strings, only decimal is supported, and in some cases (unfortunately) hexadecimal, like your comparing example. But octal is not supported in strings, and neither should binary. 0xF == 15 // true '0xF' == 15 // true 010 == 8 // true '010' == 8 // false It should be a important consideration that numeric string parsing isn't affected by this patch, and things will be fine. In fact it should be a separate discussion whether hex should work in strings at all. It's very counterproductive when parsing user input. Stan Vass