PackageTrack
Sign in Get early access

mobiledetect/mobiledetectlib

Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

4.11.0 178M downloads/mo #306 most downloaded on Packagist serbanghita/Mobile-Detect

What this package is like to depend on

Last release 3 months ago

24 May 2026

Release timing varies

gaps range from 9 days to 13 months

Rarely documented

notes for 13 of 93 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

93 releases · first in 2012

7 releases in the last 12 months

see the full history below

Release timeline

93 releases · Nov 2012 to May 2026
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 93
  1. 4.11.0 24 May 2026
    Release notes

    What's Changed

    • perf(bench): overhaul phpbench suite + advisory CI + release hygiene by @serbanghita in #1015

    Full Changelog: 4.10.0...4.11.0

    Open source →
    Release notes

    Security

    • [x] GHSA-mgj4-qjmw-v56v — the bundled Detection\Cache\Cache is now bounded (default 1000 entries, FIFO eviction). Prevents unbounded in-memory growth when one MobileDetect instance is reused across many distinct User-Agents in a long-running PHP runtime (RoadRunner, Laravel Octane, FrankenPHP worker mode, Swoole, ReactPHP, queue workers). Not applicable to classic PHP-FPM / mod_php deployments — the cache dies with the request. Custom PSR-16 adapters (Redis, APCu, Memcached, Filesystem) are out of scope; their eviction policy is the operator's responsibility.

    Added

    • [x] Detection\Cache\Cache::__construct(int $maxEntries = Cache::DEFAULT_MAX_ENTRIES) — tune the in-memory cap via new MobileDetect(new Cache($n)).
    • [x] Cache::DEFAULT_MAX_ENTRIES constant (1000) and Cache::getMaxEntries() accessor.

    Changed

    • [x] README-EXAMPLES.md "Long-Running Processes" — worker example now uses clear() (was evictExpired(), which is a no-op against fresh entries under the default 86 400 s TTL); added explicit note framing in-memory cache bounding as a systems-level concern with the bundled cap, and pointing operators at their own adapter's eviction for custom PSR-16 backends.
    • [x] Cache::evictExpired() docblock — clarified that it bounds by expiration, not by cardinality. Method behavior is unchanged.
    Open source →
  2. 4.10.0 23 Apr 2026
    Release notes

    What's Changed

    Full Changelog: 4.9.0...4.10.0

    Open source →
    Release notes

    Changed

    • [x] Detection\Cache\Cache method signatures widened to be Liskov-compatible with psr/simple-cache v1, v2, and v3 simultaneously. Resolves #989 — the class no longer fatals at load time on hosts where another package has already registered an older CacheInterface (common in WordPress stacks).
    • [x] composer.json: psr/simple-cache constraint widened to ^1.0 || ^2.0 || ^3.0.
    • [x] Minimum PHP version raised to 8.2 in composer.json (was >=8.0). PHP 8.0 and 8.1 are both end-of-life and had already been dropped from CI in 4.9.0 because phpbench/phpbench: 1.6.1 requires PHP ^8.2.

    Added

    • [x] psr16-compat CI matrix that verifies Cache remains LSP-compatible with every supported major of psr/simple-cache (1.x, 2.x, 3.x).

    BC note

    • Subclasses of Detection\Cache\Cache that overrode get/set/has/delete/getMultiple/setMultiple/deleteMultiple (or protected checkKey) with narrowed parameter types (e.g. function get(string $key, …)) will fatal at class load on this version. Drop the scalar type from the override, or widen to mixed, to restore LSP compatibility.
    Open source →
  3. 4.9.0 23 Apr 2026
    Release notes

    Minor release.

    Added

    • Lenovo: broad Lenovo TB prefix match for modern tablets (#1013).
    • Samsung: 2025 tablet models (Tab S11, S10 Lite, A11).
    • MobileDetect::VERSION_TYPE_STRING and VERSION_TYPE_FLOAT constants promoted to public (#991).

    Changed

    • Consistent late static binding for subclass extensibility (#1012).
    • Dropped PHP 8.0 and 8.1 from the CI matrix.

    Fixed

    • PHP 8.4 compatibility: explicit type hints where the engine now requires them.
    • Cache::getTimestamp() method name typo (was getTimeStamp) (#1007).
    • Version regex now accepts multi-char pre-release suffixes.
    • Pinned composer dependencies to exact versions.
    • GitHub Actions workflow actions updated to their latest versions.

    Full changelog: 4.8.10...4.9.0

    Open source →
    Release notes

    Added

    • [x] Lenovo: broad Lenovo TB prefix match for modern tablets (#1013).
    • [x] Samsung: 2025 tablet models (Tab S11, S10 Lite, A11).
    • [x] MobileDetect::VERSION_TYPE_STRING and VERSION_TYPE_FLOAT constants promoted to public (#991).

    Changed

    • [x] Consistent late static binding for subclass extensibility (#1012).
    • [x] Dropped PHP 8.0 and 8.1 from the CI matrix.

    Fixed

    • [x] PHP 8.4 compatibility: explicit type hints where the engine now requires them.
    • [x] Cache::getTimestamp() method name typo (was getTimeStamp) (#1007).
    • [x] Version regex now accepts multi-char pre-release suffixes.
    • [x] Pinned composer dependencies to exact versions.
    • [x] GitHub Actions workflow actions updated to their latest versions.
    Open source →
  4. 4.8.10 09 Jan 2026
    Release notes

    fix(cache): PSR-16 compliance for has() method and add evictExpired()…

    Open source →
    Release notes

    Fixed

    • [x] Cache::has() now properly checks TTL expiration before returning true (PSR-16 compliance fix). Previously, has() returned true for expired items.

    Added

    • [x] Cache::evictExpired() method to manually clean up expired cache entries. Useful for long-running processes (CLI scripts, workers, daemons) to prevent memory growth.
    • [x] Expanded test coverage for Cache class: added 17 new tests covering all if/else branches including custom defaults, DateInterval TTL, key validation edge cases, and expiration scenarios.
    • [x] README-EXAMPLES.md with comprehensive usage examples including long-running processes, framework integration, and debugging.

    Changed

    • [x] Cache::has() now deletes expired items on check (lazy cleanup, consistent with get() behavior).
    Open source →
  5. 3.74.4 15 Apr 2026
    Release notes

    Release 3.74.4 - Sync regex patterns and test data from 4.8.x

    Open source →
  6. 3.74.3 27 Oct 2023

    Nothing published for this version

  7. 3.74.2 17 Oct 2023

    Nothing published for this version

  8. 3.74.0 04 Dec 2022

    Nothing published for this version

  9. 2.8.47 14 Apr 2026
    Release notes

    Release 2.8.47 - Sync regex patterns and test data from 4.8.x

    Open source →
  10. 2.8.46 14 Apr 2026
    Release notes

    Release 2.8.46 - Fix PHP 8.4 implicit nullable parameter deprecation

    Open source →
  11. 2.8.45 07 Nov 2023

    Nothing published for this version

  12. 2.8.44 07 Nov 2023

    Nothing published for this version

  13. 2.8.43 01 Nov 2023

    Nothing published for this version

  14. 2.8.42 27 Oct 2023

    Nothing published for this version

  15. 2.8.41 08 Nov 2022

    Nothing published for this version

  16. 2.8.40 08 Nov 2022

    Nothing published for this version

  17. 2.8.39 17 Feb 2022

    Nothing published for this version

  18. 2.8.38 14 Feb 2022

    Nothing published for this version

  19. 2.8.37 19 Feb 2021

    Nothing published for this version

  20. 2.8.36 13 Feb 2021

    Nothing published for this version

  21. 2.8.35 25 Jan 2021

    Nothing published for this version

  22. 2.8.34 18 Sep 2019

    Nothing published for this version

  23. 2.8.33 01 Sep 2018

    Nothing published for this version

  24. 2.8.32 03 Jun 2018

    Nothing published for this version

  25. 2.8.31 26 Feb 2018

    Nothing published for this version

  26. 2.8.30 18 Dec 2017

    Nothing published for this version

  27. 2.8.29 10 Dec 2017

    Nothing published for this version

  28. 2.8.28 09 Dec 2017

    Nothing published for this version

  29. 2.8.27 03 Dec 2017

    Nothing published for this version

  30. 2.8.26 29 Aug 2017

    Nothing published for this version

  31. 2.8.25 29 Mar 2017

    Nothing published for this version

  32. 2.8.24 11 Nov 2016

    Nothing published for this version

  33. 2.8.23 10 Nov 2016

    Nothing published for this version

  34. 2.8.22 24 Apr 2016

    Nothing published for this version

  35. 2.8.21 18 Apr 2016

    Nothing published for this version

  36. 2.8.20 24 Mar 2016

    Nothing published for this version

  37. 2.8.19 24 Dec 2015

    Nothing published for this version

  38. 2.8.18 24 Dec 2015

    Nothing published for this version

  39. 2.8.17 17 Sep 2015

    Nothing published for this version

  40. 2.8.16 31 Aug 2015

    Nothing published for this version

  41. 2.8.15 18 Jun 2015

    Nothing published for this version

  42. 2.8.14 16 Jun 2015

    Nothing published for this version

  43. 2.8.13 25 Apr 2015

    Nothing published for this version

  44. 2.8.12 11 Mar 2015

    Nothing published for this version

  45. 2.8.11 23 Nov 2014

    Nothing published for this version

  46. 2.8.10 22 Nov 2014

    Nothing published for this version

  47. 2.8.8 22 Nov 2014

    Nothing published for this version

  48. 2.8.7 20 Nov 2014

    Nothing published for this version

  49. 2.8.6 20 Nov 2014

    Nothing published for this version

  50. 2.8.5 20 Oct 2014

    Nothing published for this version

  51. 2.8.4 25 Aug 2014

    Nothing published for this version

  52. 2.8.3 10 Jul 2014

    Nothing published for this version

  53. 2.8.2 16 Jun 2014

    Nothing published for this version

  54. 2.8.1 04 Jun 2014

    Nothing published for this version

  55. 2.8.0 21 Apr 2014

    Nothing published for this version

  56. 2.7.9 07 Mar 2014

    Nothing published for this version

  57. 2.7.8 05 Feb 2014

    Nothing published for this version

  58. 2.7.7 17 Jan 2014

    Nothing published for this version

  59. 2.7.6 05 Dec 2013

    Nothing published for this version

  60. 2.7.5 27 Nov 2013

    Nothing published for this version

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