PHP 4.0 Bug #6369: Bitwise OR does not work with negative numbers

From: Date: Sat, 26 Aug 2000 17:55:12 +0000
Subject: PHP 4.0 Bug #6369: Bitwise OR does not work with negative numbers
Groups: php.dev 
Request: Send a blank email to php-dev+get-30774@lists.php.net to get a copy of this message
From: jonny@1409.org Operating system: Linux 2.2.16 PHP version: 4.0.1pl2 PHP Bug Type: Misbehaving function Bug description: Bitwise OR does not work with negative numbers Bitwise OR does not work with negative numbers, example: number 1: -123456789 (10000111010110111100110100010100) number 2: 234567890 (00001101111110110011100011010010) Result: 10000111010110111100110100010100 00001101111110110011100011010010 10000010000000001100010100000100 A bit in the resulting number is only set, if it's set in the first number and NOT set in the second number!? This does only occur if one number is negative, with two positive numbers it works fine.

« previous php.dev (#30774) next »