PHPackages                             stygian91/php-cordyceps - 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. stygian91/php-cordyceps

ActiveLibrary

stygian91/php-cordyceps
=======================

0.3.0(1y ago)07MITPHPPHP ^7.4 || ^8.1

Since Jun 2Pushed 1y ago1 watchersCompare

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

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

What is it?
===========

[](#what-is-it)

Cordyceps is a small package that provides two primary classes: `Option` and `Result` for dealing with null values and errors respectively.

Option
------

[](#option)

`Option` is a wrapper around values that could be null, which allows us to reduce the number of null checks that we need to do after every operation that might return a null value. After all of our operations are done, only then do we have to unwrap the inner value and check if it actually exists.

Example:

```
