Re: Re: Remove get_browser() from core

From: Date: Thu, 03 Dec 2015 13:59:52 +0000
Subject: Re: Re: Remove get_browser() from core
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-89567@lists.php.net to get a copy of this message
Den 2015-12-03 kl. 13:44, skrev Martin Keckeis:
2015-12-02 21:02 GMT+01:00 Andrea Faulds <ajf@ajf.me>:
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

« previous php.internals (#89567) next »