Refactored getDeep to avoid error in PHP 5.4 regarding references being variables