$tally['zero']['status']='hello';
echo $tally['zero']['status'];
//prints hello, this is expected
在这个例子中,为什么只打印第一个字母?
$tally = array( "zero" => '0');
$tally['zero']['status']='hello';
echo $tally['zero']['status'];
// prints h, I was expecting hello
在这个例子中,为什么会抛出错误?
$tally['zero'] = 0;
$tally['zero']['status']='hello';
echo $tally['zero']['status'];
//prints Warning: Cannot use a scalar value as an array