Is this a bug?
This example should return 000001 but returns 000019.
What am I doing wrong?
This array is becouse this file is load intro the class method;
PHP Version 5.6.19.
XAMPP for Windows 5.6.19
<?
global $str;
$str = array();
$str[000000] = "000000";
$str[000001] = "000001";
$str[000002] = "000002";
$str[000003] = "000003";
$str[000004] = "000004";
$str[000005] = "000005";
$str[000006] = "000006";
$str[000007] = "000007";
$str[000008] = "000008";
$str[000009] = "000009";
$str[000010] = "000010";
$str[000011] = "000011";
$str[000012] = "000012";
$str[000013] = "000013";
$str[000014] = "000014";
$str[000015] = "000015";
$str[000016] = "000016";
$str[000017] = "000017";
$str[000018] = "000018";
$str[000019] = "000019";
$str[000020] = "000020";
echo $str[000001];
?>
echo 0000015;vs.echo '0000015';and the issue should become clearer. Yes, the overall answer is those meddling octals. Try$str['000015'] = "000015";and useecho $str['000015'];to get the result you expect.