Mantis - Quercus
Viewing Issue Advanced Details
2071 minor always 10-16-07 10:55 10-18-07 13:32
ferg  
nam  
normal  
closed  
fixed  
none    
none 3.1.4  
0002071: Check "^" operator
(rep by Leo)

when i was tring to move a php application to Resin, i got some error, finally i found i found this question, the result of "^" is different, who can tell me why? and is this my misconfigurature?
any help will be appreciated .

Notes
(0002364)
ferg   
10-18-07 10:07   
sorry , i omitted it , "^" means xor operation, just like 1 ^ 2 and so on

and my test code below, it got different result in resin 3.1.1 (Within Quercus which support php 5.2.0) and php 5.2.0 which released by www.php.net

<?

phpinfo();

$str1 = 'aaa';
$str2 = '123';

echo strlen($str1).'';

$ctr = 0;
$tmp = '';
for($i = 0;$i < strlen($str1); $i++) {
$ctr = $ctr == strlen($str2) ? 0 : $ctr;
$tmp .= $str2[$ctr].($str1[$i] ^ $str2[$ctr++]);
}

echo $tmp;

?>

Quercus got "112233" while php with apache got "1P2S3R"

maybe it's some kind of bug caused by charset? confused me really, T_T
(0002366)
nam   
10-18-07 13:32   
php/0383
php/3383