給定深度嵌套陣列:$array = array('nested' => array('so' => array('deep' => array())));
索引到嵌套數組VS使用最深層次的引用?
...哪個更快/更好?
$array['nested']['so']['deep'][0] = 'a';
$array['nested']['so']['deep'][1] = 'b';
$array['nested']['so']['deep'][2] = 'c';
或
$deep = &$array['nested']['so']['deep'];
$deep[0] = 'a';
$deep[1] = 'b';
$deep[2] = 'c';
或者他們一樣嗎?如果是這樣,是最好的,爲什麼?
您需要對此進行配置文件(請參見[xdebug等](http://www.sitepoint.com/faster-php-apps-profile-your-code-with-xdebug/))。 – mario 2011-12-15 16:53:25