PackageTrack
Sign in Get early access

cbschuld/browser.php

A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.

v2.0.0 7.3M downloads/mo #2120 most downloaded on Packagist cbschuld/Browser.php

What this package is like to depend on

Last release 11 months ago

04 Sep 2025

Ships unpredictably

gaps range from 8 days to 5.4 years

Nearly every release is documented

notes for 7 of 7 stable releases

Nothing withdrawn

no release was ever pulled

7 years old

7 releases · first in 2019

1 release in the last 12 months

see the full history below

Release timeline

7 releases · Jun 2019 to Sep 2025
2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 7
  1. v2.0.0 04 Sep 2025
    Release notes

    Added

    • PSR-4 autoloading with cbschuld namespace
    • Return type declarations on key methods (setVersion, checkBrowserEdge, etc.)
    • compareVersion() method for PHP 8+ compatible version comparisons
    • Enhanced Edge browser detection (supports Edge/, Edg/, EdgA/, EdgiOS/ patterns)
    • Root-level Browser.php shim for non-Composer backward compatibility
    • GitHub Actions CI pipeline (replaces Travis CI)
    • Support metadata in composer.json
    • Comprehensive upgrade documentation (UPGRADING.md)

    Changed

    • BREAKING: Minimum PHP version is now 8.0 (was 7.2)
    • BREAKING: Added return type declarations to key methods (may affect extenders)
    • BREAKING: Class is now namespaced as cbschuld\Browser
    • Updated PHPUnit to 9.6 for broad PHP 8.x compatibility
    • Updated phpunit.xml.dist to PHPUnit 9.6 schema
    • Fixed fgetcsv escape parameter for PHP 8.1+ compatibility
    • Removed composer.lock from repository (library best practice)

    Removed

    • Support for PHP 7.x
    • Travis CI configuration (.travis.yml)
    • Composer branch alias

    Migration

    • See UPGRADING.md for detailed migration instructions
    • Backward compatibility maintained via automatic class aliasing
    • Non-Composer users can still use direct includes

    Breaking Changes

    PHP Version Requirement

    • Minimum PHP version: 8.0+ (was 7.2+)
    • Reason: Enables modern PHP features and improved performance

    Namespace Introduction

    • New namespace: cbschuld\Browser
    • Migration path: See usage examples below

    Return Type Declarations

    • Added return type hints to protected methods
    • Impact: If you extend the Browser class and override protected methods, you'll need to add matching return types
    • Example: protected function checkBrowserEdge(): bool (was protected function checkBrowserEdge())
    Open source →
    Release notes

    Added

    • PSR-4 autoloading with cbschuld namespace
    • Return type declarations on key methods (setVersion, checkBrowserEdge, etc.)
    • compareVersion() method for PHP 8+ compatible version comparisons
    • Enhanced Edge browser detection (supports Edge/, Edg/, EdgA/, EdgiOS/ patterns)
    • Root-level Browser.php shim for non-Composer backward compatibility
    • GitHub Actions CI pipeline (replaces Travis CI)
    • Support metadata in composer.json
    • Comprehensive upgrade documentation (UPGRADING.md)

    Changed

    • BREAKING: Minimum PHP version is now 8.0 (was 7.2)
    • BREAKING: Added return type declarations to key methods (may affect extenders)
    • BREAKING: Class is now namespaced as cbschuld\Browser
    • Updated PHPUnit to 9.6 for broad PHP 8.x compatibility
    • Updated phpunit.xml.dist to PHPUnit 9.6 schema
    • Fixed fgetcsv escape parameter for PHP 8.1+ compatibility
    • Removed composer.lock from repository (library best practice)

    Removed

    • Support for PHP 7.x
    • Travis CI configuration (.travis.yml)
    • Composer branch alias

    Migration

    • See UPGRADING.md for detailed migration instructions
    • Backward compatibility maintained via automatic class aliasing
    • Non-Composer users can still use direct includes
    Open source →
  2. v1.9.6 14 Apr 2020
    Release notes

    Adds

    • support for Android Edge

    Removes

    • tests for 7.2 as it was dropped by Travis CI/trusty

    Changes

    • moved from /lib to /src for classes to get ready for 2.0 which will support PSR-4 loading
    Open source →
  3. 1.9.5 06 Apr 2020
    Release notes

    Added

    • better support for the Edge Browser
    • updated travis to trusty and removed 7.2, added 7.4 for tests
    • added better/additional Edge tests

    Thanks

    Open source →
  4. 1.9.4 09 Jul 2019
    Release notes

    Added

    • Added better support for Firefox Mobile
    • Added support for the Brave browser
    • Added support for the UCBrowser
    • Added more tests for specific User Agents and more IE tests (removed duplicate UAs as well)
    Open source →
    Release notes

    Added

    • Added better support for Firefox Mobile
    • Added support for the Brave browser
    • Added support for the UCBrowser
    • Added more tests for specific User Agents and more IE tests (removed duplicate UAs as well)
    Open source →
  5. 1.9.3 08 Jul 2019
    Release notes

    Added support for curl, wget and palemoon. Also added testing for both.

    Open source →
    Release notes

    Added

    • Added support for curl, wget and the Palemoon browser
    Open source →
  6. 1.9.2 26 Jun 2019
    Release notes

    Added testing to this release, updated the firefox and chrome sensors. Test suite addresses Firefox, Chrome and Opera detection with 3684 individual user-agent tests.

    Added

    • PHPUnit Tests for Firefox, Opera and Chrome (3684 tests, 7368 assertions)
    • Stronger tests for Firefox and Chrome

    Removed

    • Dropped support for 5.x PHP due to updates to PHPUnit and legacy nature of 5.X
    Open source →
    Release notes

    Added

    • PHPUnit Tests for Firefox, Opera and Chrome (3684 tests, 7368 assertions)
    • Stronger tests for Firefox and Chrome

    Removed

    • Dropped support for 5.x PHP due to updates to PHPUnit and legacy nature of 5.X
    Open source →
  7. 1.9.1 09 Jul 2019
    Release notes

    6/19/2019: Update (Version 1.9.1)

    • Added Firefox iOS (gejobj)
    • Corrected 'Vivalidi' to 'Vivaldi' (adaxi)
    • Reset enhancement (yahasana)
    • Enforce using precise distribution until End Of Life for Travis CI (bburnichon)
    • Lazy load browser class on demand (bburnichon)
    Open source →
    Release notes

    Added

    6/19/2019: Update (Version 1.9.1)

    • Added Firefox iOS (gejobj)
    • Corrected 'Vivalidi' to 'Vivaldi' (adaxi)
    • Reset enhancement (yahasana)
    • Enforce using precise distribution until End Of Life for Travis CI (bburnichon)
    • Lazy load browser class on demand (bburnichon)
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive