# DesignPatternsPHP/DesignPatternsPHP

Sample code for several design patterns in PHP 8.x

Repository: https://github.com/DesignPatternsPHP/DesignPatternsPHP
Canonical: https://ross.abutalabs.com/products/designpatternsphp
Language: PHP
License: MIT
License Family: permissive
Topics: designpatternsphp, php, design-patterns, design-pattern, oop, modern-php, code-examples, phpunit, php8
Last push: 2025-02-03T08:45:02+00:00

## Health v2 (maintenance only)
Score: 34/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 4, release rhythm 35, longevity 100
- inputs: {"age_days": 5490, "days_push": 576, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 22186, forks 4506 (observed 2026-08-28T04:11:32.418927+00:00)

## What it is
A collection of sample code implementations of well-known software design patterns in PHP 8.x, with explanations and runnable PHPUnit tests. It is accompanied by hosted documentation on Read the Docs available as HTML, PDF, and Epub.

## Use cases
- learn how to implement design patterns in PHP
- see examples of creational, structural, and behavioral patterns
- study modern PHP 8 object-oriented code
- find out which design pattern fits a given problem
- run example pattern code with PHPUnit tests

## When to choose
- you are a PHP developer learning or teaching design patterns
- you want concise, tested reference implementations of classic patterns
- you need modern PHP 8.x code examples for OOP idioms

## When to avoid
- you need a production-ready pattern library to import into your project
- you work in a language other than PHP
- you want exhaustive coverage of every pattern variant or architectural patterns

## Facets
- artifact type: learning-resource
- maturity: active
- function: developer-tools, documentation, testing
- domain: developer-tools, tutorials, programming-languages
- platform: php, cross-platform
- tags: design-patterns, oop, php8, code-examples, phpunit

## Member repositories
- DesignPatternsPHP/DesignPatternsPHP (main) score 34

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:32.418927+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-29T16:57:42.278086+00:00, confidence not recorded.
  - readme: https://github.com/DesignPatternsPHP/DesignPatternsPHP (fetched 2026-08-28T04:11:32.418927+00:00, sha 68348a4ea306)
- Data as of 2026-08-30T08:39:29.467469+00:00.
