Return type of a given variable.
@param array || double || integer || json || object || string
@return string type of variable
190447
public static function type($data = false) {

        if ($data) {

            $dataType = gettype($data);

            if ($dataType === 'string') {

                if (Validate::isJson($data)) {
                    $dataType = 'json';
                }
            }

            return $dataType;
        }

        return false;
    }
863593
protected function determineType($value)
    {
        if ($value instanceof Expression || $value instanceof ValueGenerator) {
            return self::TYPE_EXPRESSION;
        }

        switch (gettype($value)) {
            case 'boolean':
                return self::TYPE_BOOLEAN;
            case 'integer':
                return self::TYPE_INTEGER;
            case 'string':
                return self::TYPE_STRING;
            case 'double':
            case 'float':
                return self::TYPE_NUMBER;
            case 'array':
                return self::TYPE_ARRAY;
            case 'NULL':
                return self::TYPE_NULL;
            case 'object':
                return self::TYPE_OBJECT;
            default:
                return self::TYPE_OTHER;
        }
    }
220408
private function guess_type($value)
    {
        $type = 'string';

        // array requires hint to be passed.

        if (preg_match('/^[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?$/', $value)) {
            $type = 'double';
        }
        else if (preg_match('/^\d+$/', $value)) {
            $type = 'integer';
        }
        else if (preg_match('/^(t(rue)?)|(f(alse)?)$/i', $value)) {
            $type = 'boolean';
        }

        return $type;
    }
1250653
protected function getNumberType()
    {
        $scale = $this->getScale();
        if ($scale === 0) {
            return PHP_INT_SIZE > 4
                ? NumberFormatter::TYPE_INT64
                : NumberFormatter::TYPE_INT32;
        }
        return NumberFormatter::TYPE_DOUBLE;
    }
91499
protected static function parseTypes($types)
    {
        static::loadTypes();

        return Collection::make(is_array($types) ? $types : func_get_args())
                         ->map(function ($type) {
                             // If the type equals a constant's value, just return it.
                             if (is_numeric($type) && in_array($type, static::$resolvedTypes)) {
                                 return (int) $type;
                             }

                             // Otherwise we'll assume the type is the constant's name.
                             return Arr::get(static::$resolvedTypes, strtoupper($type));
                         })
                         ->reject(function ($value) {
                             return is_null($value) || $value === false;
                         })->toArray();
    }
422483
protected function evalVarLabel($variable)
    {
        $type = $this->getType($variable);
        switch ($type) {
            case 'object':
                return $this->evalObjLabel($variable);

            case 'array':
                return $type . '('.count($variable).')';

            default:
                return $type;
        }
    }
799273
private static function getType( $key, $value )
	{
		if( is_object( $value ))
			$type	= 'object';
		elseif( is_array( $value ) )
			$type	= self::isAssoc( $value ) ? 'object' : 'array';
		elseif( is_int( $value ) || is_float( $value ) || is_double( $value ) )
			$type	= 'number';
		elseif( is_string( $value ) )
			$type	= 'string';
		elseif( is_bool( $value ) )
			$type	= 'boolean';
		elseif( is_null( $value ) )
			$type	= 'null';
		else
			throw new InvalidArgumentException( 'Variable "'.$key.'" is not a supported Type.' );
		return $type;
	}
331464
static function getArrayType($type){
        self::isArray($type) or \PhpBoot\abort(new \InvalidArgumentException("$type is not array"));
        if($type == 'array') {
            return 'mixed';
        }else{
            return substr($type,0,-2);
        }
    }
608080
public static function getType( $value )
    {
        $type = gettype($value);
        switch( $type ){
        case 'string':
            return $type . '(' . strlen($value) . ')';
            break;
        case 'integer':
        case 'float':
        case 'boolean':
            return $type . '(' . $value . ')';
            break;
        case 'NULL':
        case 'unknown type':
            return $type;
            break;
        case 'array':
            return $type . '(' . count($value) . ')';
            break;
        case 'object':
            if ( $value instanceof \Countable ){
                return get_class( $value ) . '(' . count($value) . ')';
            }
            elseif ( $value instanceof HashableInterface ){
                return get_class( $value ) . '(hash=' . $value->hash() . ')';
            }
            return get_class( $value );
            break;
        }
        return '';
    }
748828
protected function varToString($var)
    {
        if (is_object($var)) {
            return get_class($var);
        }

        if (is_array($var)) {
            return 'Array';
        }

        if (is_resource($var)) {
            return sprintf('Resource(%s)', get_resource_type($var));
        }

        if (null === $var) {
            return 'null';
        }

        if (false === $var) {
            return 'false';
        }

        if (true === $var) {
            return 'true';
        }

        return (string) gettype($var);
    }
149846
private function encapsVar() {
    static $offset_types = [T_STRING, T_NUM_STRING, T_VARIABLE];
    $node = new StringVariableNode();
    if ($this->tryMatch(T_DOLLAR_OPEN_CURLY_BRACES, $node)) {
      if ($this->tryMatch(T_STRING_VARNAME, $node)) {
        if ($this->tryMatch('[', $node)) {
          $node->addChild($this->expr());
          $this->mustMatch(']', $node);
        }
      }
      else {
        $node->addChild($this->expr());
      }
      $this->mustMatch('}', $node);
      return $node;
    }
    elseif ($this->tryMatch(T_CURLY_OPEN, $node)) {
      $node->addChild($this->variable());
      $this->mustMatch('}', $node);
      return $node;
    }
    elseif ($this->mustMatch(T_VARIABLE, $node)) {
      if ($this->tryMatch('[', $node)) {
        if (!in_array($this->currentType, $offset_types)) {
          throw new ParserException(
            $this->filename,
            $this->iterator->getLineNumber(),
            $this->iterator->getColumnNumber(),
            'expected encaps_var_offset (T_STRING or T_NUM_STRING or T_VARIABLE)');
        }
        $node->addChild($this->tryMatchToken($offset_types));
        $this->mustMatch(']', $node);
      }
      elseif ($this->tryMatch(T_OBJECT_OPERATOR, $node)) {
        $this->mustMatch(T_STRING, $node);
      }
      return $node;
    }
    throw new ParserException(
      $this->filename,
      $this->iterator->getLineNumber(),
      $this->iterator->getColumnNumber(),
      'expected encaps variable');
  }
236675
function varType( v )
{
  const [ , type ] = Object.prototype.toString.call( v ).match(/\[object\s(\w+)\]/);

  return type;
}
852080
function getType(val) {
		switch (typeof val) {
			case 'object':
				return !val ? NUL : (isArray(val) ? ARY : (isMarkup(val) ? RAW : ((val instanceof Date) ? VAL : OBJ)));
			case 'function':
				return FUN;
			case 'undefined':
				return NUL;
			default:
				return VAL;
		}
	}
208008
def get_type(obj, **kwargs):
    """"""
    t = type(obj)

    s = extract_type(str(t))

    return 'Type: {}'.format(s)
1324044
function getType(obj) {
    let typeStr = typeof(obj);
    if (obj) {
        return Array.isArray(obj) ? 'array' : typeStr;
    } else {
        switch (typeStr) {
            case 'number':
                return obj === 0 ? 'number' : 'NaN';
            case 'object':
                return 'null';
            default:
                return typeStr;
        }
    }
}
384962
public static String getVariableType(String type) throws IOException {
        if (getVariableTypes() != null) {
            String newType = getVariableTypes().get(type);
            if (newType != null)
                return newType;
        }
        return type;
    }
330912
protected function getVarType($var, $arrayLevel = 0)
    {
        $phpType = gettype($var);
        switch ($phpType) {
            case 'boolean':
                $result = 'bool';
                break;
            case 'integer':
                $result = 'int';
                break;
            case 'double':
                $result = 'float';
                break;
            case 'string':
                $result = 'string';
                break;
            case 'array':
                if ($arrayLevel > 1) {
                    $result = 'array';
                } else {
                    $result = null;
                    $first = true;
                    foreach ($var as $item) {
                        $itemType = $this->getVarType($item, $arrayLevel + 1);
                        if ($first) {
                            $result = $itemType;
                            $commonObjectDescriptors = $this->getObjectDescriptors($item);
                            $first = false;
                        } else {
                            if ($result !== $itemType) {
                                $result = null;
                                if (empty($commonObjectDescriptors)) {
                                    break;
                                }
                                if (!empty($commonObjectDescriptors)) {
                                    $commonObjectDescriptors = array_intersect($commonObjectDescriptors, $this->getObjectDescriptors($item));
                                }
                            }
                        }
                    }
                    if ($result !== null) {
                        $result .= '[]';
                    } elseif (!empty($commonObjectDescriptors)) {
                        $result = array_shift($commonObjectDescriptors) . '[]';
                    } else {
                        $result = 'array';
                    }
                }
                break;
            case 'object':
                $result = get_class($var);
                if ($result === false) {
                    $result = 'mixed';
                } else {
                    if ($this->insideNamespace) {
                        $result = '\\' . $result;
                    }
                }
                break;
            case 'resource':
                $result = 'resource';
                break;
            case 'NULL':
                $result = 'null';
                break;
            case 'unknown type':
            default:
                $result = 'mixed';
                break;
        }

        return $result;
    }