Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60074 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79429 invoked from network); 17 Apr 2012 11:44:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2012 11:44:12 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:42902] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/D1-03996-9875D8F4 for ; Tue, 17 Apr 2012 07:44:10 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id A840D700043C for ; Tue, 17 Apr 2012 12:44:06 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id 31Nto3d0f25I for ; Tue, 17 Apr 2012 12:44:06 +0100 (WEST) Received: from nebm.ist.utl.pt (unknown [IPv6:2001:690:2100:4::58:1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 6F5267000423 for ; Tue, 17 Apr 2012 12:44:06 +0100 (WEST) Received: from localhost ([127.0.0.1] helo=slws007.slhq.int) by nebm.ist.utl.pt with esmtp (Exim 4.72) (envelope-from ) id 1SK6pK-0006Od-1j for internals@lists.php.net; Tue, 17 Apr 2012 12:44:06 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: Date: Tue, 17 Apr 2012 13:44:06 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.62 (Win32) Subject: Re: [PHP-DEV] is_numeric_string an hexadecimal numbers ("123" == "0x7B") From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Tue, 17 Apr 2012 13:20:33 +0200, Nikita Popov wrote: > The internal is_numeric_string [1] function is used to check whether a > string contains a number (and to extract that number). > > Currently is_numeric_string also accepts hexadecimal strings [2] > (apart from the normal decimal integers and doubles). > > [...] >In my eyes accepting hex strings in is_numeric_string leads to a quite > big WTF effect and causes problems and as such should be dropped. > > I don't think this has much BC impact, so it should be possible to > change it. > I think definitely has a larger BC impact than you're portraying, I can see some people making comparisons against '0xA' instead of 0xA. Besides, this is part of the Zend API. It's already used in many extensions (though possibly some of these should be using a stricter function) and changing its behavior is a stable branch is not wise: http://lxr.php.net/opengrok/search?q=&project=PHP_TRUNK&defs=&refs=is_numeric_string But in case, if there are no graver BC impacts, +1 for master. -- Gustavo Lopes