On 11/11/2010 8:57 PM, Christian Schneider wrote:
On Thu, Nov 11, 2010 at 3:57 PM, Jonah H. Harris<jonah.har...@gmail.com>  wrote:
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/binnotation4ints

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

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/


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to