PHPackages                             php-fp/php-fp-maybe - 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. php-fp/php-fp-maybe

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

php-fp/php-fp-maybe
===================

An implementation of the Maybe monad in PHP.

13820[4 issues](https://github.com/php-fp/php-fp-maybe/issues)PHP

Since Apr 19Pushed 8y ago2 watchersCompare

[ Source](https://github.com/php-fp/php-fp-maybe)[ Packagist](https://packagist.org/packages/php-fp/php-fp-maybe)[ RSS](/packages/php-fp-php-fp-maybe/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

The Maybe Monad for PHP. [![Build Status](https://camo.githubusercontent.com/61385ae5e02f217604c661847510035644dbe3a668beddd221b28db8e66bfe03/68747470733a2f2f7472617669732d63692e6f72672f7068702d66702f7068702d66702d6d617962652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-fp/php-fp-maybe)
=================================================================================================================================================================================================================================================================================================================

[](#the-maybe-monad-for-php-)

Intro
-----

[](#intro)

The Maybe monad is one of the first monads that you're likely to encounter when reading about monadic functional programming and, more generally, some very basic error handling. Its purpose is to model early-abort computation. Take the following example:

```
