protected static function engine() { if (preg_match('#(apachebench|dillo|gecko|khtml|presto|trident|up\\.browser|webkit|libwww|java)[\\/ ]([0-9]+(\\.[0-9]+)?)#', self::$ua, $match) || preg_match('#(msie|opera)[\\/ ]([0-9]+(\\.[0-9]+)?)#', self::$ua, $match)) { /* * IE9 and IE8 includes Trident version in their UA so we only look for empty ones * IE8 in compatibility mode identify itself as IE7 but leaves trident/4.0 in the UA */ if ('msie' === $match[1] || 'trident' === $match[1] && false !== strpos(self::$ua, 'msie 7')) { self::$engine = 'trident'; self::$engineV = 3; } else { if ('opera' == $match[1]) { $match[1] = 'presto'; } self::$engine = $match[1]; self::$engineV = floatval($match[2]); } } }