<?php
/**
 * @file
 * Auto Generated Code - DO NOT EDIT
 *
 * See http://51degrees.mobi/Support/Documentation/PHP#AutoGeneratedSourceCode for more details.*
 */

/**
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain one
 * at http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is "Incompatible With Secondary Licenses", as defined
 * by the Mozilla Public License, v. 2.0.
 */

/**
 * Calculates the edit distance between the two strings.
 *
 * &$target string
 *   The string we're trying to find the closest value to.
 * $test string
 *   The string that we're testing against.
 * $ls integer
 *   The lowest score we've found so far.
 * return integer
 *   The edit distance between the two strings.
 */
function E29($target, $test, $ls) {
  return fiftyone_degrees_edit_distance($target, $test, $ls);
}

/**
 * Returns the details of the devices that are closest to the useragent string provided.
 *
 * $useragent string
 *   The useragent we're trying to find.
 * return array
 *   An array of device details for the closest devices.
 */
function _H29($useragent) {
  $ls = PHP_INT_MAX;
  $dl = array();
  $ua = 'Bing/2.1 CFNetwork/459 Darwin/10.0.0d3';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.1 CFNetwork/485.13.9 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/485.12.7 Darwin/10.4.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/459 Darwin/10.0.0d3';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/485.13.9 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/485.12.30 Darwin/10.4.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/485.2 Darwin/10.3.1';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/548.0.3 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/485.10.2 Darwin/10.3.1';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/485.13.8 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing%20for%20iPad/1.1.2 CFNetwork/548.1.4 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'BingSearch/1.0.0 CFNetwork/485.13.9 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.1 CFNetwork/485.12.7 Darwin/10.4.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.1 CFNetwork/485.10.2 Darwin/10.3.1';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  $ua = 'Bing/2.2 CFNetwork/548.0.4 Darwin/11.0.0';
  $ns = E29($useragent, $ua, $ls);
  if ($ns <= $ls) {
    if ($ns < $ls) {
      unset($dl);
      $ls = $ns;
    }
    $dl[] = array(18254,17017,18245,18092, $ua);
  }
  return $dl;
}
