PHPackages                             norse-blue/optionals - 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. norse-blue/optionals

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

norse-blue/optionals
====================

PHP Optionals is a PHP library that allows you to chain method calls or access properties of an object while preventing errors from occurring.

0.1.0(6y ago)25MITPHPPHP ^7.3CI failing

Since Sep 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/norse-blue/php-optionals)[ Packagist](https://packagist.org/packages/norse-blue/optionals)[ Docs](https://norse.blue/open-source/php-optionals)[ RSS](/packages/norse-blue-optionals/feed)WikiDiscussions master Synced today

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

PHP Optionals
=============

[](#php-optionals)

 [![Stable Release](https://camo.githubusercontent.com/0f9f05200f47388eed00efea5bbcd7d96b10e8c883471930e8bb7b8eed14ab5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f7273652d626c75652f6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d356538316163)](https://packagist.org/packages/norse-blue/optionals) [![Build Status](https://camo.githubusercontent.com/1904d2414058ca2bb1c40de458067c0fff275c54965fd7698e65f99555f8e517/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f6e6f7273652d626c75652f7068702d6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d6275696c64266c6f676f3d7472617669732d6369266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d383863306430)](https://travis-ci.com/norse-blue/php-optionals) [![PHP Version](https://camo.githubusercontent.com/038e6ebfbd905b0d9d725247f1b43e317af51ad9ae7c0bd285c4be0d7f813750/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6e6f7273652d626c75652f6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d706870266c6f676f3d706870266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d623438656164)](https://php.net/releases) [![Maintainability](https://camo.githubusercontent.com/6290e89502a640fb3710cd79defb4d141667a3c6e0f0d6a353c6f7ec497b5367/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f6e6f7273652d626c75652f7068702d6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d6d61696e7461696e6162696c697479266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d383863306430)](https://codeclimate.com/github/norse-blue/php-optionals) [![Test Coverage](https://camo.githubusercontent.com/406eaa1dbfdf999e94d7aa47b12146e1a3e0b0c6fabd735ed9a080eb8c2eafa9/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6e6f7273652d626c75652f7068702d6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d636f766572616765266c6f676f3d636f64652d636c696d617465266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d383863306430)](https://codeclimate.com/github/norse-blue/php-optionals) [![Total Downloads](https://camo.githubusercontent.com/e3b06ccf666e2d2459b87e7b346ffaffacb8be6349381906c5a91a81b1256a7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f7273652d626c75652f6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d646f776e6c6f616473266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d383863306430)](https://packagist.org/packages/norse-blue/optionals) [![License](https://camo.githubusercontent.com/cbc6fe6be54ec1ce194f3e7ecefb2ae84e5f06eea8db5b2fb8febb345ec7a848/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6f7273652d626c75652f7068702d6f7074696f6e616c732e7376673f7374796c653d666c61742d737175617265266c6162656c3d6c6963656e7365266c6f676f436f6c6f723d65636566663426636f6c6f72413d34633536366126636f6c6f72423d613362653863)](https://github.com/norse-blue/php-optionals/blob/master/LICENSE.md)

---

**PHP Optionals** is a PHP library that allows you to chain method calls or access properties of an object while preventing errors from occurring.

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

[](#installation)

> Requirements:
>
> - [PHP 7.3+](https://php.net/releases)

Install this package using Composer:

```
composer require norse-blue/optionals
```

Usage
-----

[](#usage)

To get more in-depth knowledge about this package, please refer to the [Official Documentation](https://norse-blue.github.io/php-optionals/).

Changelog
---------

[](#changelog)

Please refer to the [CHANGELOG.md](CHANGELOG.md) file for more information about what has changed recently.

Contributing
------------

[](#contributing)

Contributions to this project are accepted and encouraged. Please read the [CONTRIBUTING.md](.github/CONTRIBUTING.md) file for details on contributions.

Credits
-------

[](#credits)

- [Axel Pardemann](https://github.com/axelitus)
- [All Contributors](../../contributors)

Security
--------

[](#security)

Please review our [security policy](https://github.com/norse-blue/php-optionals/security/policy) to know how to report security vulnerabilities within this package.

Support the development
-----------------------

[](#support-the-development)

**Do you like this project? Support it by donating**

[![Buy me a coffee](docs/assets/images/buy-me-a-coffee.svg)](https://www.buymeacoffee.com/axelitus)

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT](LICENSE.md) license.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

2427d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61386558d4fa03cc9de21d20e76f396d5568e0e647e1cdf18f12c87f1a5f87b5?d=identicon)[axelitus](/maintainers/axelitus)

---

Top Contributors

[![axelitus](https://avatars.githubusercontent.com/u/732441?v=4)](https://github.com/axelitus "axelitus (7 commits)")

---

Tags

objectpropertymethodoptional

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/norse-blue-optionals/health.svg)

```
[![Health](https://phpackages.com/badges/norse-blue-optionals/health.svg)](https://phpackages.com/packages/norse-blue-optionals)
```

###  Alternatives

[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)

PHPackages © 2026

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