使用对最深层次的引用索引到嵌套数组VS?

Given a deeply nested array: $array = array('nested' => array('so' => array('deep' => array())));

...which is faster/'better'?

$array['nested']['so']['deep'][0] = 'a';
$array['nested']['so']['deep'][1] = 'b';
$array['nested']['so']['deep'][2] = 'c';

or

$deep = &$array['nested']['so']['deep'];
$deep[0] = 'a';
$deep[1] = 'b';
$deep[2] = 'c';

Or are they the same? If so, is one preferable, and why?

Keeping a reference is faster and easier to manage, typically. However, it may not make a difference unless you are accessing it multiple times. Hashing is fast. In tests I ran recently I found that hashing is even faster than I had previously supposed. The more levels you bypass by reference, the more improvement you'll see, though.

However, the most important thing for me is that it is easier to maintain. The performance increase is likely to be negligible in most cases. I wouldn't bother doing it for performance, but if it makes your code more readable, then I'm all for it.

You probably missed another variant:

$deep[0] = 'a';
$deep[1] = 'b';
$deep[2] = 'c';
$array['nested']['so']['deep'] = $deep;

Faster and better depends a lot, these terms are quite broad. Faster to type? Decide on your own. Faster to execute? I don't think it makes worth to know in such a general form, this can make a difference in concrete places, but then you need to metric it in concrete as well to find out.