ID: 34370 User updated by: andreybl at matrix dot co dot il Reported By: andreybl at matrix dot co dot il Status: Bogus Bug Type: Documentation problem Operating System: RH EL 3.0 PHP Version: 5CVS-2005-09-05 (snap) New Comment:
Actually 0xffffffff is neither negative nor positive. It depends upon how we treat it: as signed or as unsigned. Ok. Should I close the bug? Previous Comments: ------------------------------------------------------------------------ [2005-09-05 10:57:11] [EMAIL PROTECTED] 0xffffffff isn't negative, it's 4294967295 which is over limit so 2147483647 is returned according to documentation. ------------------------------------------------------------------------ [2005-09-05 08:56:57] [EMAIL PROTECTED] Documentation should state this more clearly. ------------------------------------------------------------------------ [2005-09-05 00:32:29] andreybl at matrix dot co dot il Description: ------------ inval() for negative hex number returns the max integer value. Reproduce code: --------------- $hex1 = intval("0xffffffff", 16); $hex2 = intval("0x7fffffff", 16); var_dump($hex1, $hex2); Expected result: ---------------- int(-1) int(2147483647) Actual result: -------------- int(2147483647) int(2147483647) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34370&edit=1