Problems with large Array count group subscript
The test code is as follows:
$int = 135893597710;
Print_r ($int);
Print_r (Array ($int =>1));
The output is 135893597710Array on Windows ([ -1545355762] = 1)
Get the right results when you go to Linux 135893597710Array ([135893597710] + 1)
How can I get the correct results on Windows
Share to:
------Solution--------------------
Is your Linux 64-bit? It doesn't seem like it should happen.
Let's not take care of him, wait for a friend of 64 Linux to test it later.
It is assumed that after serialization is such a string: a:1:{i:135893597710;i:123;}
Then there are
$s = ' a:1:{i:135893597710;i:123;} ';
$s = preg_replace_callback ('/I: (\D{10,});
function ($r) {
return sprintf (' s:%d: '%s '; ', strlen ($r [1]), $r [1]);
},
$s); Change a large integer to a string
Print_r (Unserialize ($s)); Check for deserialization results
Array
(
[135893597710] = 123
)