Req #35950 [Opn]: Integer conversion and hex values
Edit report at https://bugs.php.net/bug.php?id=35950&edit=1
ID: 35950
Updated by: ajf@php.net
Reported by: tomas_matousek at hotmail dot com
Summary: Integer conversion and hex values
Status: Open
Type: Feature/Change Request
Package: *General Issues
-Operating System: Irrelevant
+Operating System: *
-PHP Version: 5.1.2
+PHP Version: *
Block user comment: N
Private report: N
New Comment:
This would be fixed by this RFC (it removes hex support): https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
Previous Comments:
------------------------------------------------------------------------
[2006-01-09 20:37:41] tomas_matousek at hotmail dot com
int(17) should be there, of course.
------------------------------------------------------------------------
[2006-01-09 20:36:46] tomas_matousek at hotmail dot com
Description:
------------
Why is (int) conversion ignoring hexadecimals if all other operation using integer conversions
convert them?
I think (int) conversion should also convert hexadecimals to be consistent with others.
Reproduce code:
---------------
$a = "0x10";
var_dump((int)$a,$a * 1,$a == "16");
Expected result:
----------------
int(16)
int(16)
int(17)
bool(true)
Actual result:
--------------
int(0)
int(16)
int(17)
bool(true)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=35950&edit=1
Thread (4 messages)