I have this piece of code:
$object = new StdClass();
$object->{'1'} = 'test_1';
$object->a = 'test_a';
$array = (array) $object;
var_dump($array) works fine, returns
array (size=2)
  '1' => string 'test_1' (length=6)
  'a' => string 'test_a' (length=6)
however,
var_dump($array[1]);   //returns null
var_dump($array['1']); //returns null
var_dump($array["1"]); //returns null
Can someone explain this behaviour? Why can't I access a property that I can see is there?
 
    