PHPackages                             setbased/error-handler - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. setbased/error-handler

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

setbased/error-handler
======================

An error handler

1.4.0(1y ago)044.7k↓10.9%12MITPHPPHP &gt;=8.3CI failing

Since Sep 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SetBased/php-error-handler)[ Packagist](https://packagist.org/packages/setbased/error-handler)[ RSS](/packages/setbased-error-handler/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (12)

ErrorHandler
============

[](#errorhandler)

An error handler for PHP.

SocialLegalReleaseTests[![Gitter](https://camo.githubusercontent.com/5bf48553d7df1eca694ac902ff0889ba6792ccc7a3b82b9c59bc547b5f6f4769/68747470733a2f2f6261646765732e6769747465722e696d2f53657442617365642f7068702d6572726f722d68616e646c65722e737667)](https://gitter.im/SetBased/php-error-handler?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)[![License](https://camo.githubusercontent.com/e315353c0da20ef5b764dc14e8eda555e6d56c6b5c817ba89107235d5ab80ebe/68747470733a2f2f706f7365722e707567782e6f72672f73657462617365642f6572726f722d68616e646c65722f6c6963656e7365)](https://packagist.org/packages/setbased/error-handler)[![Latest Stable Version](https://camo.githubusercontent.com/8d80ed35ccdafc87bd4eb209e42752fd2f5c95afd95e73556e5641d6ed09d32e/68747470733a2f2f706f7365722e707567782e6f72672f73657462617365642f6572726f722d68616e646c65722f762f737461626c65)](https://packagist.org/packages/setbased/error-handler)
[![Build Status](https://github.com/SetBased/php-error-handler/actions/workflows/unit.yml/badge.svg)](https://github.com/SetBased/php-error-handler/actions/workflows/unit.yml)
[![Code Coverage](https://camo.githubusercontent.com/b845f0ff1e92c0ddbcbf9f9b60f6aa26430ebd48a5aaa7ddbe3b4dbaee3fd632/68747470733a2f2f636f6465636f762e696f2f67682f53657442617365642f7068702d6572726f722d68616e646c65722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/SetBased/php-error-handler)PHP is a great language, however is has some quirks. One of them is that PHP has two mechanisms for signaling errors: exceptions and warnings. The following code will by default not raise an exception:

```
$handle = fopen('no-such-file.txt', 'r');
```

It will generate a waring (which is most like to be suppressed) and return false.

This library will throw exceptions in case like above instead of generating warnings.

Manual
======

[](#manual)

Add the following code at the beginning of your PHP script to throw exceptions (when possible) when a PHP warning, error, or notice occurs.

```
use SetBased\ErrorHandler\ErrorHandler;

$handler = new ErrorHandler();
$handler->registerErrorHandler();
```

Installation
============

[](#installation)

This package can be installed using composer:

```
composer require setbased/error-handler
```

Or you can obtain the sources at [GitHub](https://github.com/SetBased/php-error-handler).

License
=======

[](#license)

This project is licensed under the terms of the MIT license.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance47

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity77

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~524 days

Total

5

Last Release

390d ago

PHP version history (4 changes)1.0.0PHP &gt;=7.1.0

1.2.0PHP &gt;=7.3

1.3.0PHP &gt;=8.1

1.4.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/67edc824131704a5270570c8bba7fc52986f3e70a0389aca6b13ea87ca4d9710?d=identicon)[Paul Water](/maintainers/Paul%20Water)

---

Top Contributors

[![prwater](https://avatars.githubusercontent.com/u/17372665?v=4)](https://github.com/prwater "prwater (14 commits)")

---

Tags

errorhandler

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/setbased-error-handler/health.svg)

```
[![Health](https://phpackages.com/badges/setbased-error-handler/health.svg)](https://phpackages.com/packages/setbased-error-handler)
```

PHPackages © 2026

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