PHPackages                             webfiori/err - 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. webfiori/err

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

webfiori/err
============

A library for handling PHP errors and exceptions in a better way.

v2.0.1(7mo ago)017.0k[7 issues](https://github.com/WebFiori/err/issues)MITPHPPHP &gt;=8.1CI passing

Since May 14Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/WebFiori/err)[ Packagist](https://packagist.org/packages/webfiori/err)[ RSS](/packages/webfiori-err/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (18)Used By (0)

WebFiori Error Handler
======================

[](#webfiori-error-handler)

A comprehensive, secure, and production-ready PHP library for handling errors and exceptions with advanced security features, CLI/HTTP awareness, memory management, and enterprise-grade reliability.

 [ ![](https://github.com/WebFiori/err/actions/workflows/php83.yaml/badge.svg?branch=main) ](https://github.com/WebFiori/err/actions/workflows/php83.yaml) [ ![](https://camo.githubusercontent.com/1bdd6dabf7b89c62eabdbcbfa468b5b2d8f3b600a269a3ca8609ca1043813c36/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d57656246696f72695f657272266d65747269633d616c6572745f737461747573) ](https://sonarcloud.io/dashboard?id=WebFiori_err) [ ![](https://camo.githubusercontent.com/73f8cb2339d149bb3ba9d0617732ee35489c4721ec66af7f5b2534d4e27342ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656266696f72692f6572723f636f6c6f723d6c696768742d677265656e) ](https://packagist.org/packages/webfiori/err)

Supported PHP Versions
----------------------

[](#supported-php-versions)

Build Status[![](https://github.com/WebFiori/err/actions/workflows/php81.yaml/badge.svg?branch=main)](https://github.com/WebFiori/err/actions/workflows/php81.yaml)[![](https://github.com/WebFiori/err/actions/workflows/php82.yaml/badge.svg?branch=main)](https://github.com/WebFiori/err/actions/workflows/php82.yaml)[![](https://github.com/WebFiori/err/actions/workflows/php83.yaml/badge.svg?branch=main)](https://github.com/WebFiori/err/actions/workflows/php83.yaml)[![](https://github.com/WebFiori/err/actions/workflows/php84.yaml/badge.svg?branch=main)](https://github.com/WebFiori/err/actions/workflows/php84.yaml)Features
--------

[](#features)

- **🛡️ Security-First Design**: Built-in output sanitization, secure configuration management, and production-ready security features
- **🔄 Comprehensive Error Handling**: Converts all PHP errors to exceptions with advanced filtering and sanitization
- **🧠 Memory Management**: Advanced memory optimization with cleanup mechanisms, performance caching, and leak prevention
- **⚡ Performance Optimized**: TraceEntry caching, memory threshold monitoring, and garbage collection integration
- **🎯 Flexible Handler System**: Object-oriented abstraction with priority-based handler registration
- **🌍 Environment-Aware**: Automatic environment detection with development and production presets
- **🔧 Null Safety**: Robust null handling prevents TypeErrors in edge cases
- **📊 Comprehensive Testing**: 92 tests with 100% pass rate ensuring reliability

Installation
------------

[](#installation)

Install via Composer:

```
composer require webfiori/err
```

Or add to your `composer.json`:

```
{
    "require": {
        "webfiori/err": "^2.0"
    }
}
```

Quick Start
-----------

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
