# Installation guide

> The package has no runtime dependencies and needs no framework or PHP extension beyond the PHP core.

## System requirements

- [`PHP`](https://www.php.net/downloads) 8.3 or higher.
- [`Composer`](https://getcomposer.org/download/) for dependency management.

The package has no runtime dependencies and needs no framework or PHP extension beyond the PHP core.

## Installation

Install the package with [Composer](https://getcomposer.org/download/).

```bash
composer require php-forge/diff:^0.1
```

Every class lives in the `PHPForge\Diff` namespace and is loaded through the Composer autoloader. There is nothing to
register or configure: instantiate `LineDiffer` and call `diff()`, or `UnifiedDiffRenderer` and call `render()`.

```php
use PHPForge\Diff\{LineDiffer, UnifiedDiffRenderer};

$lines = (new LineDiffer())->diff("first\nsecond", "first\nthird");
$patch = (new UnifiedDiffRenderer())->render("first\nsecond\n", "first\nthird\n", 'a/notes.txt', 'b/notes.txt');
```

## Next steps

- 🧮 [Algorithms guide](/docs/extensions/diff/algorithms/index.md)
- 💡 [Usage examples](/docs/extensions/diff/examples/index.md)

[Back to documentation](/docs/extensions/diff/index.md#documentation)