# php-standard-library/php-standard-library

PHP Standard Library

Repository: https://github.com/php-standard-library/php-standard-library
Canonical: https://ross.abutalabs.com/products/php-standard-library
Homepage: https://php-standard-library.dev
Language: PHP
License: MIT
License Family: permissive
Topics: php, standard-library, collection, data-structures, encoding, multibyte-strings, password-hashing, json, math, pseudo-random, secure-random, type-assertion, grapheme-cluster, io, shell, html, async, non-blocking, ansi, terminal-ui
Last push: 2026-08-26T10:31:57+00:00

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

## Adoption (not part of the score)
Stars 1561, forks 91 (observed 2026-08-28T04:05:03.862235+00:00)

## What it is
PSL is a standard library for PHP inspired by Hack's HSL, providing consistent, well-typed APIs for collections, async, I/O, cryptography, validation, and terminal UI. It replaces PHP's inconsistent built-in functions with safer, async-ready alternatives that fail predictably.

## Use cases
- validate and coerce untrusted input with type combinators
- run concurrent tasks with structured concurrency in PHP
- work with collections using type-safe functional operations
- hash passwords and generate secure random values
- build terminal UIs with ANSI support
- handle multibyte strings and grapheme clusters correctly
- perform non-blocking TCP and network I/O

## When to choose
- you want a consistent, type-safe alternative to PHP's scattered built-in functions
- you need structured async concurrency in PHP without promise/callback complexity
- you're building PHP 8.4+ applications that benefit from strict typing and predictable errors

## When to avoid
- you must support PHP versions older than 8.4
- you're maintaining a legacy codebase deeply tied to native PHP functions
- you only need a tiny utility and don't want a full standard library dependency

## Facets
- artifact type: library
- maturity: active
- function: serialization, cryptography, concurrency, http-client, cli, file-system, math, logging, networking
- domain: developer-tools, programming-languages, web-development
- platform: php, cli, cross-platform
- tags: standard-library, type-safety, async, fibers, collections, data-structures, terminal-ui, type-assertion, multibyte-strings, password-hashing, command-line

## Member repositories
- php-standard-library/php-standard-library (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:03.862235+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-30T04:29:44.662281+00:00, confidence not recorded.
  - readme: https://github.com/php-standard-library/php-standard-library (fetched 2026-08-28T04:05:03.862235+00:00, sha 3e4ea8e0bfa3)
  - homepage: https://php-standard-library.dev (fetched 2026-08-29T11:29:19.179572+00:00, sha 7099da25d318)
- Data as of 2026-08-30T08:39:29.467469+00:00.
