diff --git a/reference/math/functions/dechex.xml b/reference/math/functions/dechex.xml index a6dff019fd..6099c4e72c 100644 --- a/reference/math/functions/dechex.xml +++ b/reference/math/functions/dechex.xml @@ -12,9 +12,15 @@ intnumber - Returns a string containing a hexadecimal representation of the - given number argument. The largest number that can - be converted is 4294967295 in decimal resulting to "ffffffff". + Returns a string containing a hexadecimal representation of the given + unsigned number argument. + + + The largest number that can be converted is + PHP_INT_MAX * 2 + 1 (or + -1): on 32-bit platforms, this will be + 4294967295 in decimal, which results in + dechex returning ffffffff. @@ -25,7 +31,12 @@ number - Decimal value to convert + The decimal value to convert. + + + As PHP's integer type is signed, but + dechex deals with unsigned integers, negative + integers will be treated as though they were unsigned. @@ -35,7 +46,7 @@ &reftitle.returnvalues; - Hexadecimal string representation of number + Hexadecimal string representation of number. @@ -56,6 +67,30 @@ echo dechex(47); + + + + + + <function>dechex</function> example with large integers + + +]]> + + &example.outputs; + +