Is it possible to create a variable variable pointing to an array or to nested objects? The php docs specifically say you cannot point to SuperGlobals but its unclear (to me
there is a dynamic approach for to many nested levels:
$attrs = ['level1', 'levelt', 'level3',...]; $finalAttr = $myObject; foreach ($attrs as $attr) { $finalAttr = $finalAttr->$attr; } return $finalAttr;