-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
This is a feature request. I would like the PropertyAccessor to be able to access nested properties beginning with non-alpha characters (especially '@' and '$'). These are used very often in the object trees, which have been created by parsing JSON or other markup/data format.
Example:
$object = json_decode('{ "@works" : 1, "nested" : { "@broken" : 2 } }');
$accessor = PropertyAccess::createPropertyAccessor();
$object->{'@works'}; // returns 1
$accessor->getValue($object, '@works'); // returns 1
$object->{'nested'}->{'@broken'}; // returns 2
$accessor->getValue($object, 'nested.@broken'); // throws an exception