I have some strange behavior with the unpack function. I have a packed string, stored as longblob in a mysql database. When I read that string and unpack it, it gives me an array, so far so good. But when I run this on another machine some of the values in the array are different.
When I dump the data from mysql, they are equal on both machines.
Unpacking is done this way:
$array = unpack("N*", $packed);
$array
should then be like this (and it is on one machine)
Array
(
[1] => 179848175
[2] => -16214255
[3] => 179848175
[4] => -16214255
[5] => 179848175
[6] => -16214255
[7] => 179999949
[8] => -16152916
[9] => 179999277
[10] => -16168574
...
)
But on the other machine it is like this:
Array
(
[1] => 179848175
[2] => 427853622
[3] => 179848175
[4] => 427853622
[5] => 179848175
[6] => 427853622
[7] => 179999949
[8] => 427853423
[9] => 179999277
[10] => 427853341
...
)
Every second value seems to be different.
I have tested this on three different machines, on two everything was fine, but on that one machine I get that weird output.
One machine is running PHP 5.6.3 (here it is ok), two machines are running PHP 5.5.14 (on one it is ok, on the other not)