Re: is_numeric_string an hexadecimal numbers ("123" == "0x7B")
| From: | Simon Schick | Date: | Tue, 17 Apr 2012 21:41:25 +0000 |
| Subject: | Re: is_numeric_string an hexadecimal numbers ("123" == "0x7B") | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60112@lists.php.net to get a copy of this message | ||
2012/4/17 Simon Schick <simonsimcity@googlemail.com>
>
> Hi, Gustavo
>
> That's something I didn't know of ... if we're doing that, it should,
> of course, be also be done for the dual system.
> The only thing I wonder about is the code examples you're giving ...
>
> I would expect this to work if we start to change something here:
>
> var_dump((int) '0x7b'); // int(123)
> var_dump((int) '0b1111011'); // int(123)
> var_dump((int) '0123'); // int(123)
>
> The last example was not mentioned here before but as you set in an
> example, I did it here as well ...
>
> Bye
> Simon
Hi, all
As I saw now in another thread - I forgot the octal number-system
which takes 0 as prefix ... and this would change the result of my
last example:
var_dump((int) '0173'); // int(123)
This makes me quite unsure if this should be done the way I proposed ...
Here I would not expect it to happen like this.
Bye
Simon