From:             raduc at 2software dot ro
Operating system: Linux
PHP version:      4.3.10
PHP Bug Type:     *Programming Data Structures
Bug description:  unpack returns strange values

Description:
------------
Hi,

I have a really strange behaviour with unpack() function and i didn't
found any bug / issue like this one.
The result of unpack() is diff. on a spcific server (my client's new
hosting company).
I tested the script on Win and Linux and everything works fine, with the
same .dbf file (the file is not corrupted).

Please help.

Many thanks,
Radu

Reproduce code:
---------------
$data = fread ($fp, 32) or die ("Could not read data from file
<i>$file</i>");
$header_format = 'H2id/' . 'CYear/' . 'CMonth/' . 'CDay/' . 'L# of
Records/' . 'SHeader Size/' . 'SRecord Size';
$header = unpack ($header_format, $data);


Expected result:
----------------
Array ( [id] => 03 [Year] => 105 [Month] => 7 [Day] => 2 [# of Records] =>
2713 [Header Size] => 129 [Record Size] => 58 ) 


Actual result:
--------------
Array ( [id] => 03 [Year] => 105 [Month] => 7 [Day] => 2 [# of Records] =>
2713 [Header Size] => 33024 [Record Size] => 14848 )

-- 
Edit bug report at http://bugs.php.net/?id=33649&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33649&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33649&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33649&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33649&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33649&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33649&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33649&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33649&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33649&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33649&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33649&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33649&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33649&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33649&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33649&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33649&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33649&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33649&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33649&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33649&r=mysqlcfg

Reply via email to