php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53102 the number 928 incorrectly packs (loses a bit)
Submitted: 2010-10-19 14:21 UTC Modified: 2010-10-19 15:37 UTC
From: sharpg8867 at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.14 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sharpg8867 at gmail dot com
New email:
PHP Version: OS:

 

 [2010-10-19 14:21 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-19 15:26 UTC] markskilbeck@php.net
Why is this PHP-GTK related?
 [2010-10-19 15:33 UTC] markskilbeck@php.net
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:36 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2010-10-19 15:36 UTC] cataphract@php.net
Can't reproduce in PHP 5.2.14.

We only support the latest versions.
 [2010-10-19 15:37 UTC] cataphract@php.net
-Package: PHP-GTK related +Package: *General Issues
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 09:01:26 2024 UTC