#35950 [Opn]: Integer conversion and hex values
ID: 35950
User updated by: tomas_matousek at hotmail dot com
Reported By: tomas_matousek at hotmail dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: WinXP
PHP Version: 5.1.2RC1
New Comment:
int(17) should be there, of course.
Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/?id=35950&edit=1
Thread (4 messages)