PHPackages                             joshdifabio/semantic-diff - 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. joshdifabio/semantic-diff

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

joshdifabio/semantic-diff
=========================

A library for performing semantic diffs of PHP code

1615PHP

Since Jan 30Pushed 11y ago5 watchersCompare

[ Source](https://github.com/joshdifabio/semantic-diff)[ Packagist](https://packagist.org/packages/joshdifabio/semantic-diff)[ RSS](/packages/joshdifabio-semantic-diff/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Semantic Diff for PHP
=====================

[](#semantic-diff-for-php)

[![Build Status](https://camo.githubusercontent.com/5cba156565f26465cd57eb4adfc3c845d23e1aff4dbbc6958dd8988d37503fb5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a6f73686469666162696f2f73656d616e7469632d646966662e7376673f7374796c653d666c6174)](https://travis-ci.org/joshdifabio/semantic-diff) [![Coveralls](https://camo.githubusercontent.com/b2cd5729602e61103b25c311400c25e43f4b639a6915aa0636cc464457cfb7a8/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a6f73686469666162696f2f73656d616e7469632d646966662e7376673f7374796c653d666c6174)](https://coveralls.io/r/joshdifabio/semantic-diff) [![Codacy Badge](https://camo.githubusercontent.com/463d1600e82153a5fa4c50e378fbda0104b48f5ca631898e4a0250f63fba54fe/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f35653439383236356163663934326439623433376233363232343762303134352e7376673f7374796c653d666c6174)](https://www.codacy.com/public/joshdifabio/semantic-diff)

API status
----------

[](#api-status)

Until the first tag is created, this package should be considered very unstable.

Usage
-----

[](#usage)

```
use PhpParser\Parser;
use PhpParser\Lexer;
use SemanticDiff\Diff\Factory;
use SemanticDiff\Status;

$phpParser = new Parser(new Lexer);

$diff = (new Factory)->createDiff(
    $phpParser->parse($oldPhpCode),
    $phpParser->parse($newPhpCode)
);

$status = $diff->getStatus();

/*
 * $status is now one of:
 *  Status::NO_CHANGES
 *  Status::API_ADDITIONS
 *  Status::INTERNAL_CHANGES
 *  Status::API_CHANGES
 *  Status::INCOMPATIBLE_API
 */
```

License
-------

[](#license)

Semantic Diff is released under the [MIT](https://github.com/joshdifabio/semantic-diff/blob/master/LICENSE) license.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/18f6db1b0f349a143a47f8a3c490b56ad644aa62669a0015bed16a98cdfa1985?d=identicon)[joshdifabio](/maintainers/joshdifabio)

---

Top Contributors

[![joshdifabio](https://avatars.githubusercontent.com/u/5609851?v=4)](https://github.com/joshdifabio "joshdifabio (37 commits)")

### Embed Badge

![Health badge](/badges/joshdifabio-semantic-diff/health.svg)

```
[![Health](https://phpackages.com/badges/joshdifabio-semantic-diff/health.svg)](https://phpackages.com/packages/joshdifabio-semantic-diff)
```

###  Alternatives

[typo3/cms-introduction

The Official TYPO3 Introduction Package

1880.6k5](/packages/typo3-cms-introduction)[blackbird/hyva-splide-js

An implementation of SplideJS library in Hyvä Theme for Magento 2

2016.7k](/packages/blackbird-hyva-splide-js)

PHPackages © 2026

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