code: public static function TYPE($value = null)
      {
          $value = self::flattenArrayIndexed($value);
          if (is_array($value) && (count($value) > 1)) {
              end($value);
              $a = key($value);
              //    Range of cells is an error
              if (self::isCellValue($a)) {
                  return 16;
              //    Test for Matrix
              } elseif (self::isMatrixValue($a)) {
                  return 64;
              }
          } elseif (empty($value)) {
              //    Empty Cell
              return 1;
          }
          $value = self::flattenSingleValue($value);
  
          if (($value === null) || (is_float($value)) || (is_int($value))) {
              return 1;
          } elseif (is_bool($value)) {
              return 4;
          } elseif (is_array($value)) {
              return 64;
          } elseif (is_string($value)) {
              //    Errors
              if ((strlen($value) > 0) && ($value[0] == '#')) {
                  return 16;
              }
  
              return 2;
          }
  
          return 0;
      }
docs: TYPE.
  
  Returns a number that identifies the type of a value
  
  @param null|mixed $value The value you want tested
  
  @return number N converts values listed in the following table
  If value is or refers to N returns
  A number            1
  Text                2
  Logical Value        4
  An error value        16
  Array or Matrix        64