I have downloaded the library browscap version 2.0 and added this code
$browscap = new Browscap('/tmp');
$browscap->doAutoUpdate = false;
$current_browser = $browscap->getBrowser();
The problem is when I am trying to get information about the current browser I'll have an error
Allowed memory size of 268435456 bytes exhausted (tried to allocate 281 bytes) in ....phpbrowscap-2.0/src/phpbrowscap/Browscap.php on line 677
I do not want to increase the memory because I will be losing performance since my code is executed on every load page. So I tried debugging the code, I noticed that he is checking a lot of browsers. There is a lot of values in $tmp_user_agents and he is looping over this variable.
Is there anyway to get the functionality of this library without taking too much time? Or am I missing something in how it works