Bug #66399 [Asn]: Inconsistent runtime support for integer binary/hex syntax

From: Date: Fri, 03 Jan 2014 18:19:12 +0000
Subject: Bug #66399 [Asn]: Inconsistent runtime support for integer binary/hex syntax
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183569@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66399&edit=1 ID: 66399 Updated by: requinix@php.net Reported by: benjamin at zikarsky dot de Summary: Inconsistent runtime support for integer binary/hex syntax Status: Assigned Type: Bug Package: Strings related PHP Version: 5.5.7 Assigned To: dmitry Block user comment: N Private report: N New Comment: The one particular thing I'd be worried about is someone using is_numeric() to check that a string is a number (eg, form input) and then inserting that into a SQL query: if a user entered 0b100 that now looks numeric but MySQL, for one, doesn't support it and the query would fail. (Meanwhile hex looks numeric already but MySQL supports it.) The other methods - int cast, *val() - are fine because they return a new value rather than return just information (numeric-ness) about the value. However fixing all but is_numeric() would be even more horribly inconsistent... Previous Comments: ------------------------------------------------------------------------ [2014-01-03 14:25:36] krakjoe@php.net The following patch has been added/updated: Patch Name: inconsistent-bin-hex-handling.patch Revision: 1388759136 URL: https://bugs.php.net/patch-display.php?bug=66399&patch=inconsistent-bin-hex-handling.patch&revision=1388759136 ------------------------------------------------------------------------ [2014-01-03 14:15:09] krakjoe@php.net The following patch has been added/updated: Patch Name: inconsistent-bin-hex-handling.patch Revision: 1388758509 URL: https://bugs.php.net/patch-display.php?bug=66399&patch=inconsistent-bin-hex-handling.patch&revision=1388758509 ------------------------------------------------------------------------ [2014-01-03 14:13:18] krakjoe@php.net The following patch has been added/updated: Patch Name: inconsistent-bin-hex-handling.patch Revision: 1388758398 URL: https://bugs.php.net/patch-display.php?bug=66399&patch=inconsistent-bin-hex-handling.patch&revision=1388758398 ------------------------------------------------------------------------ [2014-01-03 13:52:38] krakjoe@php.net Dmitry, assigning to you to get some attention, this appears quite important to me. I'm not able to say if the patch has adverse performance impact or introduces some strangeness you purposely left out. It looks good to me ? ------------------------------------------------------------------------ [2014-01-03 13:42:59] krakjoe@php.net All Zend and ext/standard/string tests passing ... ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=66399 -- Edit this bug report at https://bugs.php.net/bug.php?id=66399&edit=1

« previous php.bugs (#183569) next »