You are here: Re: Xor bug in all PHP versions « PHP Programming Language « IT news, forums, messages
Re: Xor bug in all PHP versions

Posted by Pedro Graca on 01/19/06 01:17

DigDug wrote:
> I get two different results in doing a Xor on a large signed double
> between linux servers.

The ^ operator takes two integers, all bitwise operator do.

> working system is kernel 2.4 . bad results server is kernel 2.6.
>
> PHP version does not matter. I compile PHP from 4.2.2 to latest.
>
> test code:
> <?PHP echo -4738698913 ^ 43814; ?>

<?php if (PHP_VERSION>='4.4.0') echo PHP_INT_MAX; ?>

<?php echo var_dump(-4738698913); ?>

<?php echo -4738698913 | 0; ?>

<?php echo var_dump(-4738698913 | 0); ?>

> results:
>
> Good result from 2.4 kernel system is -443704711

64-bit machine?

> Bad result from 2.6 kernel systems(tried 5 different systems) is
> -2147439834

32-bit machine?

> BUG in PHP or kernel?

Neither, I think.

--
If you're posting through Google read <http://cfaj.freeshell.org/google>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация