PHPackages                             roave/backward-compatibility-check - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. roave/backward-compatibility-check

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

roave/backward-compatibility-check
==================================

Tool to compare two revisions of a public API to check for BC breaks

8.20.0(2mo ago)5953.3M↓18.4%66[37 issues](https://github.com/Roave/BackwardCompatibilityCheck/issues)[5 PRs](https://github.com/Roave/BackwardCompatibilityCheck/pulls)20MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since May 26Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/Roave/BackwardCompatibilityCheck)[ Packagist](https://packagist.org/packages/roave/backward-compatibility-check)[ RSS](/packages/roave-backward-compatibility-check/feed)WikiDiscussions 8.21.x Synced 1mo ago

READMEChangelog (10)Dependencies (46)Versions (90)Used By (20)

Roave Backward Compatibility Check
==================================

[](#roave-backward-compatibility-check)

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

[![Mutation testing badge](https://camo.githubusercontent.com/1c4dbce5e2f2326784ff877a2d56493d2cb289c117951f1e7f0e8c671107a7ca/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246526f6176652532464261636b77617264436f6d7061746962696c697479436865636b253246372e312e78)](https://dashboard.stryker-mutator.io/reports/github.com/Roave/BackwardCompatibilityCheck/7.1.x)[![Type Coverage](https://camo.githubusercontent.com/e9d0555473de644416939451d17828b9e4df96a49762e81c28870bab9735a414/68747470733a2f2f73686570686572642e6465762f6769746875622f526f6176652f4261636b77617264436f6d7061746962696c697479436865636b2f636f7665726167652e737667)](https://shepherd.dev/github/Roave/BackwardCompatibilityCheck)[![Latest Stable Version](https://camo.githubusercontent.com/6f021c7b0122d8961ec01e47396d205396f5a36eb7c3ce4bf3e1cdfab567d7af/68747470733a2f2f706f7365722e707567782e6f72672f726f6176652f6261636b776172642d636f6d7061746962696c6974792d636865636b2f762f737461626c65)](https://packagist.org/packages/roave/backward-compatibility-check)[![License](https://camo.githubusercontent.com/ebfa50b2c15a536f1a9debca08c4534afabf1b0e7a772351ded69118cd20455a/68747470733a2f2f706f7365722e707567782e6f72672f726f6176652f6261636b776172642d636f6d7061746962696c6974792d636865636b2f6c6963656e7365)](https://packagist.org/packages/roave/backward-compatibility-check)

A tool that can be used to verify BC breaks between two versions of a PHP library.

Tip

Enjoy checking your API compatibility :) if you need help with this tool, auditing your code, or support on your legacy applications, feel free to [get in touch](https://roave.com/contact-us/).

\- The Roave Team

Pre-requisites/assumptions
--------------------------

[](#pre-requisitesassumptions)

- Your project uses `git`
- Your project uses `composer.json` to define its dependencies
- All source paths are covered by an `"autoload"` section in `composer.json`
- Changes need to be committed to `git` to be covered. You can implement your own logic to extract sources and dependencies from a project though.

Installation
------------

[](#installation)

```
composer require --dev roave/backward-compatibility-check
```

### Install with Docker

[](#install-with-docker)

You can also use Docker to run `roave-backward-compatibility-check`:

```
docker run --rm -v `pwd`:/app nyholm/roave-bc-check
```

Usage
-----

[](#usage)

### Adding to a continuous integration pipeline

[](#adding-to-a-continuous-integration-pipeline)

The typical intended usage is to just add `roave-backward-compatibility-check`to your CI build:

```
vendor/bin/roave-backward-compatibility-check
```

This will automatically detect the last minor version tagged, and compare the API against the current `HEAD`. If any BC breaks are found, the tool returns a non-zero status, which on most CI systems will cause the build to fail.

*NOTE:* detecting the base version only works if you have git tags in the SemVer-compliant `x.y.z` format, such as `1.2.3`.

*NOTE:* since this tool relies on tags, you need to make sure tags are fetched as part of your CI pipeline. For example in a GitHub action, note the use of [`fetch-depth: 0`](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches):

```
jobs:
  roave-backwards-compatibility-check:
    name: Roave Backwards Compatibility Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: "Install PHP"
        uses: shivammathur/setup-php@v2
        with:
          php-version: "8.0"
      - name: "Install dependencies"
        run: "composer install"
      - name: "Check for BC breaks"
        run: "vendor/bin/roave-backward-compatibility-check"
```

#### Nyholm Github Action

[](#nyholm-github-action)

Tobias Nyholm also offers [a simple GitHub action](https://github.com/Nyholm/roave-bc-check-docker)that you can use in your Github pipeline. We recommend this for most cases as it is simple to set up:

`.github/workflows/main.yml`:

```
on: [push]
name: Test
jobs:
  roave-backwards-compatibility-check:
    name: Roave Backwards Compatibility Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: "Check for BC breaks"
        uses: docker://nyholm/roave-bc-check-ga
```

### Running manually

[](#running-manually)

To generate additional documentation for changelogs:

```
vendor/bin/roave-backward-compatibility-check --format=markdown > results.md
```

### GitHub Actions

[](#github-actions)

When running in GitHub Actions, it is endorsed to use the `--format=github-actions` output format:

```
vendor/bin/roave-backward-compatibility-check --format=github-actions
```

### Documentation

[](#documentation)

If you need further guidance:

```
vendor/bin/roave-backward-compatibility-check --help
```

Configuration
-------------

[](#configuration)

The file `.roave-backward-compatibility-check.xml` is read from the current working directory (when it exists) and sets configuration for the command.

It's expected to be an XML file that follows our [schema](Resources/schema.xsd):

**Example:**

```

        #\[BC\] CHANGED: The parameter \$a of TestArtifact\\TheClass\#method\(\)#
        #\[BC\] CHANGED: The parameter \$b of TestArtifact\\TheClass\#method2\(\)#

```

###  Health Score

77

—

ExcellentBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity64

Solid adoption and visibility

Community45

Growing community involvement

Maturity96

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~10 days

Total

85

Last Release

53d ago

Major Versions

3.0.0 → 4.0.02019-07-17

4.4.0 → 5.0.02020-06-22

5.0.x-dev → 6.0.02021-12-26

6.5.x-dev → 7.0.02022-03-31

7.5.x-dev → 8.0.x-dev2022-11-13

PHP version history (11 changes)1.0.0PHP ^7.2

4.0.0PHP ^7.3

5.0.0PHP ^7.4.7

6.0.0PHP ~8.0.0 || ~8.1.0

7.2.0PHP ~8.1.0 || ~8.2.0

8.4.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

8.7.x-devPHP ~8.2.0 || ~8.3.0

8.12.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

8.15.0PHP ~8.3.0 || ~8.4.0

8.16.0PHP ~8.3.0 || ~8.4.0 || ~8.5.0

8.20.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd0445bc21fa116c259b5889377b90cbd8a34d49357321f76a74f6d2c2ae6b0c?d=identicon)[Ocramius](/maintainers/Ocramius)

![](https://www.gravatar.com/avatar/2734194006e4987a8e12379a63b4f6c0a4478b5818ea7ce677499b1f714a92d2?d=identicon)[asgrim](/maintainers/asgrim)

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (675 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (334 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (255 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (226 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (131 commits)")[![asgrim](https://avatars.githubusercontent.com/u/496145?v=4)](https://github.com/asgrim "asgrim (97 commits)")[![michael-rubel](https://avatars.githubusercontent.com/u/37669560?v=4)](https://github.com/michael-rubel "michael-rubel (33 commits)")[![bdsl](https://avatars.githubusercontent.com/u/159481?v=4)](https://github.com/bdsl "bdsl (30 commits)")[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (18 commits)")[![azjezz](https://avatars.githubusercontent.com/u/29315886?v=4)](https://github.com/azjezz "azjezz (13 commits)")[![Jean85](https://avatars.githubusercontent.com/u/6729988?v=4)](https://github.com/Jean85 "Jean85 (13 commits)")[![lcobucci](https://avatars.githubusercontent.com/u/201963?v=4)](https://github.com/lcobucci "lcobucci (11 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (8 commits)")[![DanielBadura](https://avatars.githubusercontent.com/u/2017762?v=4)](https://github.com/DanielBadura "DanielBadura (8 commits)")[![bendavies](https://avatars.githubusercontent.com/u/625392?v=4)](https://github.com/bendavies "bendavies (7 commits)")[![darenas31415](https://avatars.githubusercontent.com/u/16238028?v=4)](https://github.com/darenas31415 "darenas31415 (6 commits)")[![mstegmeyer](https://avatars.githubusercontent.com/u/40475653?v=4)](https://github.com/mstegmeyer "mstegmeyer (5 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (4 commits)")[![mad-briller](https://avatars.githubusercontent.com/u/28307684?v=4)](https://github.com/mad-briller "mad-briller (3 commits)")[![tomasnorre](https://avatars.githubusercontent.com/u/1212481?v=4)](https://github.com/tomasnorre "tomasnorre (3 commits)")

---

Tags

backward-compatibilitybcreflectionstatic-analysis

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/roave-backward-compatibility-check/health.svg)

```
[![Health](https://phpackages.com/badges/roave-backward-compatibility-check/health.svg)](https://phpackages.com/packages/roave-backward-compatibility-check)
```

###  Alternatives

[veewee/xml

XML without worries

1835.9M29](/packages/veewee-xml)[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[php-soap/wsdl-reader

A WSDL reader in PHP

212.3M9](/packages/php-soap-wsdl-reader)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
