symfony/polyfill-php86
Symfony polyfill that backports PHP 8.6 features to older PHP versions, including clamp(), the ARRAY_FILTER_USE_VALUE constant, the SortDirection enum, and grapheme_strrev. A lightweight MIT-licensed compatibility layer for existing projects.
clamp, SortDirection, ARRAY_FILTER_USE_VALUE) while remaining on PHP 8.1–8.5, reducing migration risk and enabling feature testing before a full runtime upgrade. The v1.43.0 maintenance release reinforces this: the package is actively patched (skipping 1.42.0 and shipping two bugfix PRs), which is the signal you want from a dependency you intend to carry temporarily through a migration window.grapheme_strrev() multibyte handling and fixes grapheme/Collator sorting, MessageFormatter integer rounding, and English list patterns — bug classes that are expensive to reproduce in-house and rarely covered by application tests. Adoption signals remain low (18 stars, 0 dependents), so treat it as a lightweight, well-maintained dependency rather than a proven critical-path component.clamp), consistent API sorting contracts (SortDirection), and simpler array filtering (ARRAY_FILTER_USE_VALUE) without forcing PHP 8.6 adoption.Adopt if:
clamp, SortDirection, ARRAY_FILTER_USE_VALUE).MessageFormatter-dependent behavior (string reversal, locale-aware sorting, number formatting) on legacy runtimes and do not want to own those edge cases yourself.Look elsewhere if:
grapheme_strrev() multibyte concern is addressed in v1.43.0, so this is no longer a standalone reason to avoid the package — but any helper outside the documented coverage is still unsupported.clamp in-house.symfony/intl or a dedicated localization library; prefer that rather than relying on a polyfill for intl-adjacent correctness.For executives: This package gives us access to selected PHP 8.6 features today without upgrading our runtime. It is a low-cost, MIT-licensed Symfony polyfill that supports a phased upgrade strategy and reduces custom compatibility code. The latest release (v1.43.0) fixes real multibyte string-reversal and locale-sorting bugs upstream, which is exactly the maintenance behavior we want from a temporary dependency. Because adoption is still small, treat it as a targeted, reversible dependency — pilot it in low-risk areas, pin the version, and plan to remove it after our PHP 8.6 migration.
For engineering: symfony/polyfill-php86 backports clamp(), ARRAY_FILTER_USE_VALUE, and the SortDirection enum to older PHP versions. v1.43.0 additionally fixes grapheme_strrev(), grapheme/Collator sorting, MessageFormatter integer rounding, and English list patterns — worth taking if you depend on those helpers, but re-run your edge-case tests rather than assuming the prior behavior. Integration is a single Composer dependency with no runtime overhead on PHP 8.6+. Use it behind function_exists() guards where practical, add boundary tests for clamp and UTF-8 cases, and document removal steps. It is best suited for legacy Laravel modules that need modern language ergonomics before a full PHP upgrade.
How can I help you explore Laravel packages today?