public static function isOneOf($instance, array $types)
    {
        $possible = self::$typeCompatibility[gettype($instance)];

        foreach ($types as $type) {
            if (isset($possible[$type])) {
                return true;
            }
        }

        return false;
    }