If I have the following code:
$a = new stdClass();
$property = 'test';
$a->$property = array();
How can I set a value inside the $a->$property array? The following doesn't work, because [] is applied on $property, not on $a->$property:
$a->$property['key'] = 'value';
Is referencing the property the only way of doing this?
$array = &$a->$property;
$array['key'] = 'value';