Re: Re: Supporting Binary Notation for Integers
| From: | Thomas Hruska | Date: | Fri, 12 Nov 2010 04:19:32 +0000 |
| Subject: | Re: Re: Supporting Binary Notation for Integers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50165@lists.php.net to get a copy of this message | ||
On 11/11/2010 8:57 PM, Christian Schneider wrote:
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H. Harris<jonah.harris@gmail.com> wrote:var_dump(is_numeric("1")); var_dump("1" == 1); var_dump("1" === 1); var_dump(is_numeric("0x1")); var_dump("0x1" == 1); var_dump("0x1" === 1); var_dump(is_numeric("0b1")); var_dump("0b1" == 1); var_dump("0b1" === 1); bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) bool(false) bool(false) bool(false) Probably would be the same as "0x1". -- Thomas Hruska CubicleSoft President Barebones CMS is a high-performance, open source content management system for web developers operating in a team environment. An open source CubicleSoft initiative. Your choice of a MIT or LGPL license. http://barebonescms.com/RFC added. I'm not sure what the protocol for RFCs is, but I put it under the In Discussion heading. Sorry if I was wrong. http://wiki.php.net/rfc/binnotation4intsJust 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