public static function removeFromArray(&$array, $keychain)
    {
        if (!is_array($array)) {
            $array = [];
        }
        if (!is_array($keychain)) {
            $keychain = [$keychain];
        }

        $headKey = array_shift($keychain);
        if (empty($keychain)) {
            //last
            unset($array[$headKey]);
        } else {
            //not last
            if (isset($array[$headKey])) {
                self::removeFromArray($array[$headKey], $keychain);
            }
        }
    }