code: public function getPdoType($data)
      {
          static $typeMap = [
              // php type => PDO type
              'boolean' => \PDO::PARAM_BOOL,
              'integer' => \PDO::PARAM_INT,
              'string' => \PDO::PARAM_STR,
              'resource' => \PDO::PARAM_LOB,
              'NULL' => \PDO::PARAM_NULL,
          ];
          $type = gettype($data);
  
          return isset($typeMap[$type]) ? $typeMap[$type] : \PDO::PARAM_STR;
      }
docs: Determines the PDO type for the given PHP data value.
  @param mixed $data the data whose PDO type is to be determined
  @return int the PDO type
  @see https://secure.php.net/manual/en/pdo.constants.php