original_string: public function getIpVersion($ip)
      {
          if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
              return self::IPv6;
          }
  
          else if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
              return self::IPv4;
          }
          // invalid ip
          return false;
      }
code: public function getIpVersion($ip)
      {
          if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
              return self::IPv6;
          }
  
          else if (false !== filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
              return self::IPv4;
          }
          // invalid ip
          return false;
      }
code_tokens: public function getIpVersion ( $ ip ) { if ( false !== filter_var ( $ ip , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) ) { return self :: IPv6 ; } else if ( false !== filter_var ( $ ip , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ) ) { return self :: IPv4 ; } // invalid ip return false ; }
docstring: Get IP verison
  
  @param string $ip
  @return integer|boolean Returns version or false on invalid address
docstring_tokens: Get IP verison