Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89567 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38462 invoked from network); 3 Dec 2015 14:00:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2015 14:00:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.155 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.155 v-smtpout2.han.skanova.net Received: from [81.236.60.155] ([81.236.60.155:44693] helo=v-smtpout2.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7B/36-02069-CDA40665 for ; Thu, 03 Dec 2015 08:59:57 -0500 Received: from [192.168.7.4] ([195.198.188.252]) by cmsmtp with SMTP id 4UQLazUJsMCmr4UQLah8mW; Thu, 03 Dec 2015 14:59:54 +0100 To: Martin Keckeis , Andrea Faulds References: Cc: PHP internals Message-ID: <56604AD8.9010908@telia.com> Date: Thu, 3 Dec 2015 14:59:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfJoyBZBKDqKvpLhyMEctEOO9/WtslHcDlIaFvfKfi6BYVdNQm+1DRYzE3QywmYLoT09BvJcQPsqX24FR0w8UHIKYIW1ZzeIOWJV0U3gp1CHCr4TdagnFhfoyffIPlpJKRdi79tbA4/8bv32i9bi+U1cnCc8zo5ecHBlUW6LmBLIOZP6d3QcORKTfmmQr7SkWYi/em7ODxch4tste6dzZ0rGirFlfPwmXVmrPJjs2dR99GQq4748N3Li701w9R2wGTQ== Subject: Re: [PHP-DEV] Re: Remove get_browser() from core From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2015-12-03 kl. 13:44, skrev Martin Keckeis: > 2015-12-02 21:02 GMT+01:00 Andrea Faulds : > >> Hi Martin, >> >> Martin Keckeis wrote: >> >>> i think it's time to deprecate the function get_browser(). >>> >>> The reason is simple: Since the browscap.ini file has grown a lot this >>> function does need way too much time, see here for example >>> >>> http://stackoverflow.com/questions/12067641/get-browser-slowing-down-page-load-any-alternative >>> >>> The underlying browscap.ini file is still a very resource to use and there are very good official packages out there to use it >>> https://packagist.org/packages/browscap/browscap-php >>> >>> I also compared the browscap.ini file to other UserAgent parsers around and it looks still good >>> http://thadafinser.github.io/UserAgentParserComparison/results/index.html >>> >> I'd also support removing get_browser(), but for a different reason: it >> encourages user agent sniffing, which is a bad practice that has led to the >> mess that is modern User-Agent headers. The web is an open platform which >> degrades gracefully, where you can detect if browsers support features you >> need and adapt accordingly. Detecting specific browsers is harmful to >> competition and not future-proof. >> >> Thanks. >> >> -- >> Andrea Faulds >> http://ajf.me/ >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > User agent sniffing was sadly missused to detect e.g. if it's a mobile > device and redirect to a mobile page -> which is wrong right. > > But user agent sniffing is still a good information source for different > things: > - statistics / analytics > - cross selling > - ... > > But that's not needed in a language core anyway :-) > Also good for cuctomer support. Knowing roughly which browser users have is quite helpful for e.g. finding errors in web apps. //Björn