Can someone please offer a work-a-round for the following script.
Adding $x1 and $x2 together works fine, but when I take the
result (in $y1) to the power of $x3, it fails on some Linux platforms,
but not others. Makes no difference if using PHP 4 or PHP 5.
I've tested this on seven different servers.
On any that are running RedHat 9 or FreeBSD, the
script works correctly. On any running CentOS (32 bit)
or RedHat Enterprise, the script comes up with the
wrong answer.
<?php
$x1=-1639260211;
$x2=-1558980842;
$x3=3888969200;
$y1 = $x1+$x2;
$y2 = ($y1) ^ ($x3);
echo "y1: ".$y1."\n";
echo "y2: ".$y2."\n";
?>
FreeBSD:
y1: -3198241053
y2: -1500364013 <--- The correct answer
CentOS:
y1: -3198241053
y2: 1741485552 <--- The Wrong answer