sebastianbergmann/diff

Diff implementation

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 33 minutes ago
Added to GitGenius on September 8th, 2026
Created on February 12th, 2013
Open Issues & Pull Requests: 3 (+0)
GitHub issues: Enabled
Number of forks: 89
Total Stargazers: 7,651 (+0)
Total Subscribers: 25 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.4 hours
Mean response time: 180.5 days
90th percentile: 567.9 days
Tracked items: 13

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 13% of issues opened in the past year have been closed. Three people close 100% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 116 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (2)
  • type/dependencies (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

sebastian/diff is a PHP library that generates and parses unified diff output.

The library solves the problem of programmatically comparing two strings and representing their differences in a human-readable format. It provides the Differ class to generate textual diffs and the Parser class to parse unified diff format back into an object graph. The tool supports multiple output formats: UnifiedDiffOutputBuilder for standard unified diff output used by PHPUnit, StrictUnifiedDiffOutputBuilder for strict unified diff format compatible with patch and git apply, and DiffOnlyOutputBuilder for output containing only differing lines. Developers can also implement the DiffOutputBuilderInterface to generate custom output formats.

This library is well-suited for projects that need to display or analyze code changes, such as testing frameworks, version control tools, or code review systems. It works as a standalone component, having been factored out of PHPUnit into a reusable dependency. Projects should add it as a development-time dependency if diff generation is only needed during testing or development workflows.

The project maintains a focused scope on diff generation and parsing without attempting to provide broader version control functionality. Development activity shows consistent maintenance with regular updates addressing edge cases and output format requirements. The codebase demonstrates attention to compatibility with standard Unix diff tools and Git workflows through its strict unified diff output builder. The project accepts contributions that extend output format options while preserving backward compatibility with existing implementations.