Awesome Open Source
Awesome Open Source

PHP CompatInfo

Stable Upcoming
Latest Stable Version Unstable Version
Minimum PHP Version) Minimum PHP Version)
Branch Master Branch 6.0

PHP CompatInfo is a library that can find the minimum version and the extensions required for a piece of code to run.

Running on PHP greater than 7.1 for parsing source code in a format PHP 5.2 to PHP 8.0


  • PHP 7.1.3 or greater
  • PHPUnit 7 or greater (if you want to run unit tests)


The recommended way to install this library is through composer. If you don't know yet what is composer, have a look on introduction.

composer require bartlett/php-compatinfo

Build PHAR distribution

Since release 5.4.2 building of phar version of application is part of composer automated process.

Either when you install or update project with Composer, the bin/phpcompatinfo.phar file will be built.


  • You may avoid this by invoking composer command with --no-scripts option.
  • You may also rebuild the phar file by invoking composer compile-box command (shortcut of run, run-script).


Full documentation is written in MarkDown format, and HTML export is possible with See output results at or raw *.md files in docs folder.

Table of Contents

  • Features

    • Parse source code in format PHP 5.2 to PHP 8.0
    • Detect PHP features for each Major/minor versions
    • Detect versions of all directives, constants, functions, classes, interfaces of 100 extensions and more
    • Display/Inspect list of extensions, and their versions supported
  • Components

  • Configurations

    • Use of PSR11 containers to configure application services.


  • Laurent Laville (Lead Dev)
  • Thanks to Nikita Popov who wrote a marvellous PHP Parser.
  • Thanks also to Remi Collet, a contributor of first hours.
  • Credits to Davey Shafik. He introduced his proposal in 2004, that gave birth of a PEAR package named PHP_CompatInfo.


This project is licensed under the BSD-3-Clause License - see the LICENSE file for details

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
php (15,953
compatibility (23

Find Open Source By Browsing 7,000 Topics Across 59 Categories