Bug #12590 Updated: hex const (0xABCDEF01) parsing error

From: Date: Thu, 18 Oct 2001 20:00:18 +0000
Subject: Bug #12590 Updated: hex const (0xABCDEF01) parsing error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68270@lists.php.net to get a copy of this message
ID: 12590 Updated by: jeroen Reported By: vda@port.imtp.ilyichevsk.odessa.ua Old Status: Feedback Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.0.5 New Comment: On most platforms (including i386), PHP does not support integers of 2**31 (0x80 00 00 00) and higher. See the manual on integers. So the result of the second expression is unknown. (0x800000FF is converted to float because of integer-overflow, and you cannot use bitwise fucntions on floats) Previous Comments: ------------------------------------------------------------------------ [2001-10-18 15:45:55] sander@php.net What would you expect to get? On my machine, it prints out 255 twice. ------------------------------------------------------------------------ [2001-08-06 07:35:58] vda@port.imtp.ilyichevsk.odessa.ua Looks like there's some trouble with parsing big hex consts (those with sign bit set). Try this: ... echo (0x7FFF00FF & 0xFFFF); //echoes 255 echo (0x800000FF & 0xFFFF); //echoes 0!!! ... 0x800000FF apparently is mis-parsed. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12590&edit=1

« previous php.dev (#68270) next »