PHPackages                             leafs/exception - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. leafs/exception

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

leafs/exception
===============

Error handler for leaf (fork of whoops)

v3.7(8mo ago)243.9k—4.8%1MITPHPPHP ^5.5.9 || ^7.0 || ^8.0

Since Mar 15Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/leafsphp/exceptions)[ Packagist](https://packagist.org/packages/leafs/exception)[ Docs](https://github.com/leafsphp/exception)[ GitHub Sponsors](https://github.com/denis-sokolov)[ RSS](/packages/leafs-exception/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (59)Used By (1)

Leaf Exception (Whoops)
=======================

[](#leaf-exception-whoops)

PHP errors for cool kids

[![Total Downloads](https://camo.githubusercontent.com/d5acf988173e9f83f0120aa97e8656970b53d7941af09e7968747eb4dc39c09f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6c656166732f657863657074696f6e2e737667)](https://packagist.org/packages/leafs/exception)[![Latest Version](https://camo.githubusercontent.com/3e3a83b922acb913d9768334eefa438f5b4a240fe580760d4f59ba4f657c4112/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c656166732f657863657074696f6e2e737667)](https://packagist.org/packages/leafs/exception)

---

[![Whoops!](https://camo.githubusercontent.com/48f51f1bae3d461cfa0f5465c4904345f3c1595b7c1dabf5a04853b8c686b210/68747470733a2f2f692e696d6775722e636f6d2f7764786a5556342e706e67)](https://camo.githubusercontent.com/48f51f1bae3d461cfa0f5465c4904345f3c1595b7c1dabf5a04853b8c686b210/68747470733a2f2f692e696d6775722e636f6d2f7764786a5556342e706e67)

**whoops** is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debug your web projects, but at heart it's a simple yet powerful stacked error handling system.

Features
--------

[](#features)

- Flexible, stack-based error handling
- Stand-alone library with (currently) no required dependencies
- Simple API for dealing with exceptions, trace frames &amp; their data
- Includes a pretty rad error page for your webapp projects
- Includes the ability to [open referenced files directly in your editor and IDE](docs/Open%20Files%20In%20An%20Editor.md)
- Includes handlers for different response formats (JSON, XML, SOAP)
- Easy to extend and integrate with existing libraries
- Clean, well-structured &amp; tested code-base

Sponsors
--------

[](#sponsors)

[![Blackfire.io](https://camo.githubusercontent.com/2a73710603b06dc49d180ab3d51bcdf093ef2620f37b19a5b42202b6cc59e65c/68747470733a2f2f692e696d6775722e636f6d2f7a52387273716b2e706e67)](https://blackfire.io/docs/introduction?utm_source=whoops&utm_medium=github_readme&utm_campaign=logo)

Installing
----------

[](#installing)

If you use Laravel 4, Laravel 5.5+ or [Mezzio](https://docs.mezzio.dev/mezzio/), you already have Whoops. There are also community-provided instructions on how to integrate Whoops into [Silex 1](https://github.com/whoops-php/silex-1), [Silex 2](https://github.com/texthtml/whoops-silex), [Phalcon](https://github.com/whoops-php/phalcon), [Laravel 3](https://gist.github.com/hugomrdias/5169713#file-start-php), [Laravel 5](https://github.com/GrahamCampbell/Laravel-Exceptions), [CakePHP 3](https://github.com/dereuromark/cakephp-whoops/tree/cake3), [CakePHP 4](https://github.com/dereuromark/cakephp-whoops), [Zend 2](https://github.com/ghislainf/zf2-whoops), [Zend 3](https://github.com/Ppito/zf3-whoops), [Yii 1](https://github.com/igorsantos07/yii-whoops), [FuelPHP](https://github.com/indigophp/fuel-whoops), [Slim](https://github.com/zeuxisoo/php-slim-whoops/), [Pimple](https://github.com/texthtml/whoops-pimple), [Laminas](https://github.com/Ppito/laminas-whoops), or any framework consuming [StackPHP middlewares](https://github.com/thecodingmachine/whoops-stackphp)or [PSR-7 middlewares](https://github.com/franzliedke/whoops-middleware).

If you are not using any of these frameworks, here's a very simple way to install:

1. Use [Composer](http://getcomposer.org) to install Whoops into your project:

    ```
    composer require filp/whoops
    ```
2. Register the pretty handler in your code:

    ```
    $whoops = new \Whoops\Run;
    $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
    $whoops->register();
    ```

For more options, have a look at the **example files** in [`examples/`](./examples) to get a feel for how things work. Also take a look at the [API Documentation](docs/API%20Documentation.md) and the list of available handlers below.

You may also want to override some system calls Whoops does. To do that, extend `Whoops\Util\SystemFacade`, override functions that you want and pass it as the argument to the `Run` constructor.

You may also collect the HTML generated to process it yourself:

```
$whoops = new \Whoops\Run;
$whoops->allowQuit(false);
$whoops->writeToOutput(false);
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$html = $whoops->handleException($e);
```

### Available Handlers

[](#available-handlers)

**whoops** currently ships with the following built-in handlers, available in the `Whoops\Handler` namespace:

- [`PrettyPageHandler`](https://github.com/filp/whoops/blob/master/src/Whoops/Handler/PrettyPageHandler.php) - Shows a pretty error page when something goes pants-up
- [`PlainTextHandler`](https://github.com/filp/whoops/blob/master/src/Whoops/Handler/PlainTextHandler.php) - Outputs plain text message for use in CLI applications
- [`CallbackHandler`](https://github.com/filp/whoops/blob/master/src/Whoops/Handler/CallbackHandler.php) - Wraps a closure or other callable as a handler. You do not need to use this handler explicitly, **whoops** will automatically wrap any closure or callable you pass to `Whoops\Run::pushHandler`
- [`JsonResponseHandler`](https://github.com/filp/whoops/blob/master/src/Whoops/Handler/JsonResponseHandler.php) - Captures exceptions and returns information on them as a JSON string. Can be used to, for example, play nice with AJAX requests.
- [`XmlResponseHandler`](https://github.com/filp/whoops/blob/master/src/Whoops/Handler/XmlResponseHandler.php) - Captures exceptions and returns information on them as a XML string. Can be used to, for example, play nice with AJAX requests.

You can also use pluggable handlers, such as [SOAP handler](https://github.com/whoops-php/soap).

Authors
-------

[](#authors)

This library was primarily developed by [Filipe Dobreira](https://github.com/filp), and is currently maintained by [Denis Sokolov](https://github.com/denis-sokolov). A lot of awesome fixes and enhancements were also sent in by [various contributors](https://github.com/filp/whoops/contributors). Special thanks to [Graham Campbell](https://github.com/GrahamCampbell) and [Markus Staab](https://github.com/staabm) for continuous participation.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance62

Regular maintenance activity

Popularity31

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity82

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 ~81 days

Recently: every ~69 days

Total

57

Last Release

242d ago

Major Versions

0.9.0 → 1.0.02013-04-09

1.1.9 → 2.0.0-alpha12015-12-12

0.1 → v3.02022-01-27

PHP version history (6 changes)0.8.4PHP &gt;=5.3.0

1.1.8PHP &gt;=5.3.0 &lt;6

2.0.0-alpha1PHP &gt;=5.3.3

2.0.0-alpha2PHP &gt;=5.5.9

2.1.4PHP ^5.5.9 || ^7.0

0.1PHP ^5.5.9 || ^7.0 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29547806?v=4)[Mychi](/maintainers/Mychi)[@mychi](https://github.com/mychi)

---

Top Contributors

[![denis-sokolov](https://avatars.githubusercontent.com/u/113721?v=4)](https://github.com/denis-sokolov "denis-sokolov (452 commits)")[![filp](https://avatars.githubusercontent.com/u/382538?v=4)](https://github.com/filp "filp (307 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (59 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (57 commits)")[![jonasdt](https://avatars.githubusercontent.com/u/1201842?v=4)](https://github.com/jonasdt "jonasdt (25 commits)")[![mychidarko](https://avatars.githubusercontent.com/u/26604242?v=4)](https://github.com/mychidarko "mychidarko (23 commits)")[![prisis](https://avatars.githubusercontent.com/u/2716058?v=4)](https://github.com/prisis "prisis (10 commits)")[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (10 commits)")[![SBLAdam](https://avatars.githubusercontent.com/u/81582882?v=4)](https://github.com/SBLAdam "SBLAdam (8 commits)")[![acidjazz](https://avatars.githubusercontent.com/u/967369?v=4)](https://github.com/acidjazz "acidjazz (7 commits)")[![franzliedke](https://avatars.githubusercontent.com/u/249125?v=4)](https://github.com/franzliedke "franzliedke (7 commits)")[![Geolim4](https://avatars.githubusercontent.com/u/1332071?v=4)](https://github.com/Geolim4 "Geolim4 (7 commits)")[![ibnsultan](https://avatars.githubusercontent.com/u/28471267?v=4)](https://github.com/ibnsultan "ibnsultan (6 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (6 commits)")[![bobdenotter](https://avatars.githubusercontent.com/u/1833361?v=4)](https://github.com/bobdenotter "bobdenotter (5 commits)")[![cs278](https://avatars.githubusercontent.com/u/17377?v=4)](https://github.com/cs278 "cs278 (5 commits)")[![hugomrdias](https://avatars.githubusercontent.com/u/314190?v=4)](https://github.com/hugomrdias "hugomrdias (4 commits)")[![fujiwaraizuho](https://avatars.githubusercontent.com/u/30709744?v=4)](https://github.com/fujiwaraizuho "fujiwaraizuho (4 commits)")[![gwillz](https://avatars.githubusercontent.com/u/3466850?v=4)](https://github.com/gwillz "gwillz (4 commits)")[![tflori](https://avatars.githubusercontent.com/u/4855611?v=4)](https://github.com/tflori "tflori (4 commits)")

---

Tags

libraryexceptionerrorhandlingwhoopsthrowable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/leafs-exception/health.svg)

```
[![Health](https://phpackages.com/badges/leafs-exception/health.svg)](https://phpackages.com/packages/leafs-exception)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[ikkez/f3-falsum

Pretty error handling for Fat-Free Framework

21145.8k3](/packages/ikkez-f3-falsum)[topshelfcraft/canary

The kinder, cuter, cleverer Craft error handler.

114.4k](/packages/topshelfcraft-canary)

PHPackages © 2026

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