PHPackages                             brimmar/phpresult - 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. brimmar/phpresult

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

brimmar/phpresult
=================

A Rust-like Result Type for PHP

v1.1.0(5mo ago)33971[3 PRs](https://github.com/brimmar/phpresult/pulls)MITPHPPHP ^8.3CI passing

Since Aug 1Pushed 1mo ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (13)Used By (0)

PHP Result Type Documentation
=============================

[](#php-result-type-documentation)

[![Tests](https://github.com/brimmar/phpresult/actions/workflows/tests.yml/badge.svg)](https://github.com/brimmar/phpresult/actions/workflows/tests.yml)[![Static Analysis](https://github.com/brimmar/phpresult/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/brimmar/phpresult/actions/workflows/static-analysis.yml)[![License](https://camo.githubusercontent.com/58044d7ad060c0fdad8ceff75b76d4b6a154188c4f43f588ab4a683c2420996f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6272696d6d61722f706870726573756c74)](https://packagist.org/packages/brimmar/phpresult)[![Latest Stable Version](https://camo.githubusercontent.com/ab27cdd4fc6cd36e1dd0199be440fc2317775cc531cacd9bf22f0b9fc311c680/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272696d6d61722f706870726573756c74)](https://packagist.org/packages/brimmar/phpresult)[![Total Downloads](https://camo.githubusercontent.com/e40ca6cfb424b64aa313ae6fbe8060310785965f98b0e3f9d10c3aed42fb99fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272696d6d61722f706870726573756c74)](https://packagist.org/packages/brimmar/phpresult)

This documentation covers the implementation of a Rust-like Result Type for PHP. The Result type is used for returning and propagating errors. It has two variants: `Ok`, representing success and containing a value, and `Err`, representing error and containing an error value.

Table of Contents
-----------------

[](#table-of-contents)

1. [Result Interface](#result-interface)
2. [Usage](#usage)
3. [Methods](#methods)
4. [Complementary Packages](#complementary-packages)
5. [Static Analysis](#static-analysis)
6. [Contributing](#contributing)
7. [Security Vulnerabilities](#security-vulnerabilities)
8. [License](#License)

Result Interface
----------------

[](#result-interface)

The `Result` interface defines the contract for both `Ok` and `Err` classes.

```
