No, it's not working because PHP arrays don't work that way. $a is not a reliable way to access the first element of an array. Take a look at the following code.
$a = array (
'1' => 'one',
'2' => 'two',
'0' => 'zero'
echo $a['0']; // zero, as we'd expect.
echo $a; // zero ?? yep, zero, even though $a['0'] is the 3rd element of the array
echo reset($a); // one.
Numerical references to keys do not work reliably unless care is taken. PHP 'arrays' are what other languages would call dictionaries, lists, or even free form objects. Understand that and you understand that there isn't much operative difference between $a = array() and $a = new stdClass(); Both constructs can have members arbitrarily assigned to them, sometimes to curious or disastrous effect.
PHP key types aren't meant to be interchangeable. This sometimes happens, especially in code written for the older database drivers which will return db results with both associative and integer keys (unless commanded not to do so). If you choose to treat them that way, be prepared to be surprised as the code I jotted down about shows.
Personally I'm all for object oriented code, but there's something to be said for list and dictionary management. To that end I heavily use the ArrayObject class and extend off of the offsetSet function to control the data that can be placed in the array when that is necessary. I prefer having the array access syntax be used to mark the difference between the data, and object settings and properties. For example, in my template class $template->template is the html file the template will use when evaluated. $template['template'] can be set, but whatever meaning it has will be up to the person writing the template - it has no special meaning to the class.
PHP arrays are one of the most powerful features of the language, but they are also badly misnamed as they combine several discreet data structure concepts into one. Be careful with them.