#39641 [NoF->Opn]: Expression evaluation violates intuition

From: Date: Thu, 08 Feb 2007 16:39:53 +0000
Subject: #39641 [NoF->Opn]: Expression evaluation violates intuition
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108587@lists.php.net to get a copy of this message
 ID:               39641
 User updated by:  netex at 163 dot com
 Reported By:      netex at 163 dot com
-Status:           No Feedback
+Status:           Open
 Bug Type:         Variables related
 Operating System: FreeBSD 6.1
 PHP Version:      5.2.0
 New Comment:

Still happens in 5.2.1


Previous Comments:
------------------------------------------------------------------------

[2006-12-05 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2006-11-27 09:54:22] tony2001@php.net

That's exactly what I get on Linux and FreeBSD 5.5-RELEASE.

------------------------------------------------------------------------

[2006-11-27 05:10:48] netex at 163 dot com

Description:
------------
Expression evaluation violates intuition, see the code:

Reproduce code:
---------------
<?
$a = -1109046485 & 0xffffffff;
$b = -1129749216 & 0xffffffff;
printf("%x + %x = %x\n",$a,$b,$a+$b);
printf("%x\n", 0xbde54b2b + 0xbca96520);
?>


Expected result:
----------------
X-Powered-By: PHP/5.2.0
Content-type: text/html

bde54b2b + bca96520 = 7a8eb04b
7a8eb04b


Actual result:
--------------
X-Powered-By: PHP/5.2.0
Content-type: text/html

bde54b2b + bca96520 = 80000000
7a8eb04b



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39641&edit=1


Thread (4 messages)

« previous php.bugs (#108587) next »