Collision improves how PHP command-line applications display errors and exceptions. It is commonly used with Laravel and requires PHP 8.2 or newer when installed via Composer.
Overview
Collision is a Composer package that formats errors for terminal-oriented PHP programs. It focuses on readable output when exceptions occur during CLI interaction with an application.
Laravel projects can pull it in as a dev dependency with version lines matched to their framework release. For other stacks you register the error handler yourself in bootstrap code so uncaught failures use Collision’s presenter.
The package integrates with PHPUnit, Pest, and similar test runners across Laravel versions documented in its compatibility table. Outside Laravel it remains a handler you wire into your own entry point.
Collision is maintained as open source under the MIT license. It does not run as a standalone service; it loads into PHP processes that already use Composer autoloading.
Key features
- Formatted CLI exception output
- Laravel-oriented version matrix
- Manual handler registration option
- PHPUnit and Pest compatibility notes
- Composer-based installation
- PHP 8.2 plus requirement
- Developer-focused stack traces
- MIT licensed package
Use cases
- Prettier Laravel Artisan error output
- Consistent CLI failures in PHP tools
- Test run reporting with Collision adapters
- Custom PHP scripts needing rich errors
- Local debugging of console commands