public static function recursive_unset(&$obj, $path)
    {
        $i = 1;
        foreach (($l = explode('|', $path)) as $key) {
            if (is_object($obj)) {
                if (isset($obj->$key)) {
                    if (count($l) === $i) {
                        unset($obj->$key);
                        return true;
                    }
                    $obj = &$obj->$key;
                } else {
                    return false;
                }
            } else {
                if (isset($obj[$key])) {
                    if (count($l) === $i) {
                        unset($obj[$key]);
                        return true;
                    }
                    $obj = &$obj[$key];
                } else {
                    return false;
                }
            }   
            $i++;
        }
        return null;
    }