Bug #53102 [Opn->Bgs]: the number 928 incorrectly packs (loses a bit)

[email protected] Tue, 19 Oct 2010 15:36:42 +0200 (CEST)
Newsgroups php.gtk.dev
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=53102&edit=1

 ID:                 53102
 Updated by:         [email protected]
 Reported by:        sharpg8867 at gmail dot com
 Summary:            the number 928 incorrectly packs (loses a bit)
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            PHP-GTK related
 PHP Version:        5.2.14
 Block user comment: N

 New Comment:

Can't reproduce in PHP 5.2.14.

We only support the latest versions.


Previous Comments:
------------------------------------------------------------------------
[2010-10-19 15:33:42] [email protected]

Also, you should provide a test script that people can *actually* run,
not leaving us to infer the steps you took to produce the issue.

------------------------------------------------------------------------
[2010-10-19 15:26:29] [email protected]

Why is this PHP-GTK related?

------------------------------------------------------------------------
[2010-10-19 14:21:09] sharpg8867 at gmail dot com

Description:
------------
a) packing the value 928 (0x3A0) and 927 (0x39F) as unsigned long ("N")
always converts to 927 (0x39F)
 
b) masking the lower 8 bits of 0x3A0 always reads as 0x3F or 159

Note: phpinfo reports PHP Version 5.2.13

Test script:
---------------
$value = 928;
pack("N",$value) is 0x39f (927)

$value = 927;
pack("N",$value) is 0x39f (927)

$value = 928;
$v0 = $value & 0xff;
$v0 prints as 927

Expected result:
----------------
928 packs as 928.

Actual result:
--------------
928 packs as 927

Not good for computer to lose bits.


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



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