There are many questions similar to this, however this is slightly different since it\'s about deep object property access, not just one level of depth.
Let\'s say I
It is very easy to reduce the object path using variable property notation ($o->$p):
$o->$p
$path = 'foo.bar'; echo array_reduce(explode('.', $path), function ($o, $p) { return $o->$p; }, $user);
This could easily be turned into a small helper function.