# symfony/polyfill-php80

Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions

Repository: https://github.com/symfony/polyfill-php80
Canonical: https://ross.abutalabs.com/products/polyfill-php80
Homepage: https://symfony.com/polyfill-php80
Language: PHP
License: MIT
License Family: permissive
Topics: symfony, polyfill, component, symfony-component, compatibility, javascript, portable, shim, symfony-polyfill
Last push: 2026-04-26T14:44:42+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 79, release rhythm 81, longevity 100
- inputs: {"age_days": 2409, "days_push": 129, "days_rel": 129, "gap_med": 3, "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 1725, forks 26 (observed 2026-08-28T04:05:28.118747+00:00)

## What it is
A Symfony component that backports PHP 8.0 core features (such as str_contains, str_starts_with, str_ends_with, Stringable, ValueError, and PhpToken) to older PHP versions. It lets libraries and applications use PHP 8.0 APIs while still running on PHP 7.x.

## Use cases
- use str_contains and str_starts_with on PHP 7.4
- make my library compatible with older PHP versions
- backport PHP 8.0 features to PHP 7
- get Stringable interface and ValueError on legacy PHP
- run code using PhpToken on PHP 7
- avoid version checks for PHP 8 string functions

## When to choose
- you maintain a library supporting both PHP 7 and PHP 8
- you need PHP 8.0 core functions/classes on older runtimes
- you want a tiny, MIT-licensed, widely-tested compatibility shim

## When to avoid
- your code targets PHP 8.0+ only
- you need polyfills for newer PHP versions like 8.1 or 8.2 (use the matching polyfill packages)

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools, programming-languages, cross-platform
- platform: php, cli
- tags: polyfill, shim, php8, compatibility, symfony-component

## Member repositories
- symfony/polyfill-php80 (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:28.118747+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-30T03:33:52.973284+00:00, confidence not recorded.
  - readme: https://github.com/symfony/polyfill-php80 (fetched 2026-08-28T04:05:28.118747+00:00, sha aa82982386e9)
  - homepage: https://symfony.com/polyfill-php80 (fetched 2026-08-29T11:09:17.599905+00:00, sha 382a8120ff1e)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T11:09:17.608731+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T11:09:17.610896+00:00, sha 5bd749e2b676)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T11:09:17.612915+00:00, sha 0739a28df2e8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
