Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Polyfill Php86 Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Roadmap: phased PHP upgrade – Lets teams adopt PHP 8.6 features (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.
  • Build vs. buy – Avoids custom utility code for clamping, sorting enums, and array-filter constants; uses a Symfony-maintained, MIT-licensed polyfill. v1.43.0 also corrects 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.
  • Feature decisions – Enables cleaner input validation and data normalization (clamp), consistent API sorting contracts (SortDirection), and simpler array filtering (ARRAY_FILTER_USE_VALUE) without forcing PHP 8.6 adoption.
  • Laravel use cases – Backporting numeric range capping in form requests, standardizing sort direction in query builders or API resources, simplifying collection/array filtering logic in legacy Laravel apps, and — with v1.43.0 — safely using grapheme-aware helpers in localized form validation and sort ordering on legacy runtimes.
  • Technical debt strategy – Supports temporary forward-compatibility, with an explicit plan to remove the polyfill after upgrading to PHP 8.6+. The steady upstream fix cadence lowers the risk of a known-buggy helper lingering in production while you wait.

When to Consider This Package

  • Adopt if:

    • Your application runs PHP < 8.6 but needs one or more of the covered features (clamp, SortDirection, ARRAY_FILTER_USE_VALUE).
    • You are planning a PHP upgrade and want to pilot new language features with minimal infrastructure change.
    • Your Laravel/Symfony stack already depends on Symfony polyfills, making this a low-friction addition.
    • You need grapheme-, collation-, or MessageFormatter-dependent behavior (string reversal, locale-aware sorting, number formatting) on legacy runtimes and do not want to own those edge cases yourself.
    • You need an MIT-licensed, Symfony-backed compatibility layer and can accept the package’s currently limited adoption.
  • Look elsewhere if:

    • You are already on PHP 8.6+; the polyfill is redundant.
    • You need PHP 8.6 features beyond the covered set. Note that the previously flagged 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.
    • You prioritize minimal dependencies and can implement simple helpers like clamp in-house.
    • The low star count and zero dependents are a blocker for production adoption; wait for broader ecosystem validation or restrict use to non-critical modules.
    • Your team cannot commit to testing polyfill behavior against native PHP 8.6 or planning for eventual removal.
    • You are already standardizing on symfony/intl or a dedicated localization library; prefer that rather than relying on a polyfill for intl-adjacent correctness.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator