public static function getPrimitiveTypeOf($instance)
    {
        $phpType = gettype($instance);

        if (isset(self::$phpToJson[$phpType])) {
            return self::$phpToJson[$phpType];
        }

        throw new UnsupportedTypeException($phpType);
    }