Answer the question
In order to leave comments, you need to log in
var_export array bug when its keys are negative numbers?
<?php
$data = array('moder'=> array(
-2 => array(
2=>1,
1=>1,
0=>1,
-1=>-1,
-2=>-2,
)
));
print '<pre>';
print '<h1>print_r</h1>';
print_r($data);
print '<h1>var_dump</h1>';
var_dump($data);
print '</pre>';
print '<h1>var_export (BAD keys!!!)</h1>';
$code = '<?php
return '.var_export($data, true);
print highlight_string($code);
print '<h1>serialize</h1>';
print serialize($data);
print '<h1>some script</h1>';
highlight_file(__FILE__);
<?php
return array (
'moder' =>
array (
18446744073709551614 =>
array (
2 => 1,
1 => 1,
0 => 1,
18446744073709551615 => -1,
18446744073709551614 => -2,
),
),
)
<?php
return array (
'moder' =>
array (
-2 =>
array (
2 => 1,
1 => 1,
0 => 1,
-1 => -1,
-2 => -2,
),
),
)
Answer the question
In order to leave comments, you need to log in
Apparently, the bug was in 5.3.2, and in 5.3.10 it has already been fixed.
System x86 or x64?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question