PHPackages                             juststeveking/result - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. juststeveking/result

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

juststeveking/result
====================

A tiny, framework-agnostic Result type for PHP 8.4 that makes error handling explicit, composable, and testable.

1.0.0(7mo ago)212MITPHPPHP ^8.4CI failing

Since Sep 29Pushed 7mo agoCompare

[ Source](https://github.com/JustSteveKing/result)[ Packagist](https://packagist.org/packages/juststeveking/result)[ Docs](https://github.com/JustSteveKing/result)[ GitHub Sponsors](https://github.com/juststeveking)[ RSS](/packages/juststeveking-result/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Result
======

[](#result)

A tiny, framework-agnostic Result type for PHP that makes error handling explicit, composable, and testable.

- Express success as Ok(value) and failure as Err(Throwable)
- Eliminate nullable return values and ambiguous sentinel values
- Chain operations with map/andThen and recover with mapErr/orElse
- Ergonomic helpers and a small ComparableResult utility

Requirements
------------

[](#requirements)

- PHP 8.4+

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

[](#installation)

```
composer require juststeveking/result
```

Quick start
-----------

[](#quick-start)

```
