PHPackages                             vudaltsov/exceptionally - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. vudaltsov/exceptionally

Abandoned → [thesis/exceptionally](/?search=thesis%2Fexceptionally)Library[Validation &amp; Sanitization](/categories/validation)

vudaltsov/exceptionally
=======================

Converts errors into exceptions easily

0.1.0(6y ago)52MITPHPPHP ^7.1CI passing

Since Aug 3Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/vudaltsov/exceptionally)[ Packagist](https://packagist.org/packages/vudaltsov/exceptionally)[ RSS](/packages/vudaltsov-exceptionally/feed)WikiDiscussions 0.3.x Synced 2w ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Thesis Exceptionally
====================

[](#thesis-exceptionally)

A tiny PHP library that converts errors to exceptions.

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

[](#installation)

```
composer require thesis/exceptionally
```

Requires PHP 8.3+.

Usage
-----

[](#usage)

```
use function Thesis\exceptionally;

// Converts PHP errors to ErrorException
$content = exceptionally(static fn() => file_get_contents('/path/to/file'));
```

Many PHP functions trigger errors instead of throwing exceptions. This makes error handling inconsistent and cumbersome. `exceptionally()` wraps a callable and converts any triggered error into a native [ErrorException](https://php.net/manual/class.errorexception.php).

### Error suppression operator

[](#error-suppression-operator)

Errors suppressed with `@` are not converted to exceptions:

```
// Does not throw — the error is suppressed
$content = exceptionally(static fn() => @file_get_contents('/path/to/file'));
```

### Filtering by error level

[](#filtering-by-error-level)

By default, all levels except `E_DEPRECATED` and `E_USER_DEPRECATED` are converted. Deprecations typically come from third-party libraries and should not interrupt execution.

You can specify which levels to convert:

```
// Convert notices
$result = exceptionally($function, E_USER_NOTICE);

// Convert warnings and notices
$result = exceptionally($function, E_USER_WARNING | E_USER_NOTICE);

// Convert all, including deprecations
$result = exceptionally($function, E_ALL);
```

License
-------

[](#license)

MIT

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance55

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Every ~2426 days

Total

2

Last Release

98d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.2.x-devPHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2552865?v=4)[Valentin Udaltsov](/maintainers/vudaltsov)[@vudaltsov](https://github.com/vudaltsov)

---

Top Contributors

[![vudaltsov](https://avatars.githubusercontent.com/u/2552865?v=4)](https://github.com/vudaltsov "vudaltsov (38 commits)")

###  Code Quality

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vudaltsov-exceptionally/health.svg)

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

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

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