Re: error at function hexdec
| From: | Jakub Vrana | Date: | Thu, 26 Feb 2004 14:03:35 +0000 |
| Subject: | Re: error at function hexdec | ||
| References: | 1 2 3 4 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969359245@lists.php.net to get a copy of this message | ||
Cornelia Boenigk wrote:
> hexdec() will replace of any non-hexadecimal characters it encounters
> by 0. This way, all left zeros are ignored, but right zeros will be
> valued.
> Example 1. hexdec() example
> <?php
> var_dump(hexdec("that"));
> var_dump(hexdec("a0"));
> // both print "int(160)"
> ?>
> This is not correct. The two lines print int(10) and int(160).
> Seems the behaviour of the function is, that all non-hexadecimal
> values are ignored and *not* converted to 0.
_php_math_basetozval() in math.c says you are right :-).
Fixed in documentation CVS.
Jakub Vrana