PHPackages                             phine/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. [Testing &amp; Quality](/categories/testing)
4. /
5. phine/exception

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

phine/exception
===============

A PHP library for improving the use of exceptions.

1.0.0(12y ago)11777.7k↓14.1%211MITPHPPHP &gt;=5.3.3

Since Aug 27Pushed 12y agoCompare

[ Source](https://github.com/kherge-archive/lib-exception)[ Packagist](https://packagist.org/packages/phine/exception)[ Docs](https://github.com/phine/lib-exception)[ RSS](/packages/phine-exception/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (11)

Exception
=========

[](#exception)

[![Build Status](https://camo.githubusercontent.com/766a76add45a4b0e58734197e1987bf7f1ac88bfa80bf23134372b006928ff9c/68747470733a2f2f7472617669732d63692e6f72672f7068696e652f6c69622d657863657074696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/phine/lib-exception)[![Coverage Status](https://camo.githubusercontent.com/7188fcbcfaeb2bef950a886ef1d906fc3f6c6e1a14971b3d58a823513414d426/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7068696e652f6c69622d657863657074696f6e2f62616467652e706e67)](https://coveralls.io/r/phine/lib-exception)[![Latest Stable Version](https://camo.githubusercontent.com/d51c38b73215b394879cbbe27a88d4e753069a0df8715371b4cbb13511a1510f/68747470733a2f2f706f7365722e707567782e6f72672f7068696e652f657863657074696f6e2f762f737461626c652e706e67)](https://packagist.org/packages/phine/exception)[![Total Downloads](https://camo.githubusercontent.com/7e05f422cbabd80a58e399c715c3bfe689ed648f72c0a5d26999786c5f8e554c/68747470733a2f2f706f7365722e707567782e6f72672f7068696e652f657863657074696f6e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/phine/exception)

Adds functionality to the standard `Exception` class.

- Create new exceptions based on `sprintf()` format.
- Create new exceptions using the last error (`error_get_last()`).

Usage
-----

[](#usage)

```
use Phine\Exception\Exception;

$exception = Exception::createUsingFormat(
    'This is my %s message.',
    'formatted',
    $previousException
);

echo $undefined;

$exception = Exception::createUsingLastError();
```

Requirement
-----------

[](#requirement)

- PHP &gt;= 5.3.3

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

[](#installation)

Via [Composer](http://getcomposer.org/):

```
$ composer require "phine/exception=~1.0"

```

Documentation
-------------

[](#documentation)

You can find the documentation in the [`docs/`](docs/) directory.

License
-------

[](#license)

This library is available under the [MIT license](LICENSE).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4693d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

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

---

Tags

exception

### Embed Badge

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

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

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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