Home » File Formats » Spreadsheet_Excel_Writer » Bug #2722
Problems with PHP5 pack() function
Details
| Submitted | 2004-11-09 11:52 UTC |
|---|---|
| From | jaenichen at globalpark dot de |
| Status | Bogus |
| Package | Spreadsheet_Excel_Writer |
| PHP Version | 5.0.2 |
| OS | Linux (Suse 9.0) |
| Roadmaps | (Not assigned) |
Comments
[2004-11-09 11:52 UTC] jaenichen at globalpark dot de
Description:
------------
In PHP5 the return values of the pack() function have changed,
due to this the xls-fileformat may be corrupted.
When pack() is called with the value 0xffffffff it returns 0xffffff7f instead of 0xffffffff.
This result occured in my tests only with long-values but it may also be a problem when packing short-values.
In PHP4 a value greater than 0xffffff7f was casted to a long value.
In PHP4 a value greater than 0xffffff7f will always be set to a constant with the value 0xffffff7f.
This behaviour was posted to the PHP buglist.
It seems that the macro converting double to long values will not be changed in future versions so that there is no downwards compatibility in the pack() function anymore.
Reproduce code:
---------------
print bin2hex(pack("V", 0xffffffff));
Expected result:
----------------
ffffffff
Actual result:
--------------
ffffff7f
[2004-12-17 08:56 UTC] jaenichen at globalpark dot de
This bug is fixed in PHP version 5.0.3.