# schmittjoh/php-option

Option Type for PHP

Repository: https://github.com/schmittjoh/php-option
Canonical: https://ross.abutalabs.com/products/php-option
Language: PHP
License: Apache-2.0
License Family: permissive
Last push: 2026-08-24T01:09:02+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 75, longevity 100
- inputs: {"age_days": 5049, "days_push": 10, "days_rel": 10, "gap_med": 128, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2664, forks 67 (observed 2026-08-28T04:07:09.013583+00:00)

## What it is
A PHP library implementing the Option type (Some/None) to represent optional values instead of returning null. It forces developers to explicitly handle both the value-present and value-absent cases, making APIs more robust.

## Use cases
- avoid null pointer errors in php
- return optional values from repository methods
- make php apis null-safe
- wrap nullable values in a some/none type
- handle missing values explicitly in php
- functional option type for php

## When to choose
- you want to eliminate fatal 'call to method on null' errors
- you are designing php apis that may or may not return a value
- you prefer explicit handling of absent values over null checks

## When to avoid
- your codebase already uses php 8 nullable types and nullsafe operators
- you want a full functional programming toolkit rather than just the option type

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, developer-tools
- domain: developer-tools, programming-languages
- platform: php
- tags: option-type, functional-programming, null-safety, maybe-monad

## Member repositories
- schmittjoh/php-option (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:09.013583+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:18:19.359553+00:00, confidence not recorded.
  - readme: https://github.com/schmittjoh/php-option (fetched 2026-08-28T04:07:09.013583+00:00, sha c8367d2bf6b0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
