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

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

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

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

        return false;
    }
public static function isOneOf ( $ instance , array $ types ) { $ possible = self :: $ typeCompatibility [ gettype ( $ instance ) ] ; foreach ( $ types as $ type ) { if ( isset ( $ possible [ $ type ] ) ) { return true ; } } return false ; }
Returns whether an instance matches at least one of given JSON types.

@param mixed    $instance
@param string[] $types

@return bool
Returns whether an instance matches at least one of given JSON types .