symfony/polyfill-php84
Symfony polyfill that backports PHP 8.4 features to earlier PHP versions, including array_find, mb_trim, mb_ucfirst, fpow, bcdivmod, grapheme_str_split, the Deprecated attribute, PDO driver subclasses, and ReflectionConstant.
mb_trim, Normalizer, grapheme_levenshtein, grapheme_str_split, bcmath validation, odbc_connection_string_should_quote, uuid constants). That directly supports the "develop on polyfill, ship on native" strategy: the same code path behaves identically on PHP ≤8.3 and ≥8.4, so incremental migration stays low-risk.mb_trim with native, intl extension parity on ill-formed UTF-8, bcmath number validation) is exactly the invisible maintenance burden teams underestimate when writing their own polyfills. MIT license, no vendor lock-in.array_find/array_all untouched by this release — still the clean replacement for collect()->filter()->first().#[Deprecated] unchanged; safe to keep using for gradual API phase-outs.mb_trim, Normalizer, and intl handling of ill-formed UTF-8 match native, which matters for multilingual input validation and normalization.bcmath number validation is now stricter and aligned with native; inputs previously tolerated by the polyfill may now be rejected.odbc_connection_string_should_quote() and uuid constants aligned with native.array_find, Deprecated attribute) for new functionality.mb_trim, grapheme_str_split, Normalizer).bcdivmod, bcpow-style math) with high precision needs.HttpClient, String) that implicitly rely on these polyfills.mb_trim / Normalizer for form or API input sanitation — the 1.43.0 alignment fixes divergence from native behavior.grapheme_* or intl-backed code — ill-formed UTF-8 handling now matches the intl extension.grapheme_levenshtein / grapheme_str_split argument validation — these now validate arguments instead of silently misbehaving.bcadd/bccomp/etc. — stricter validation may surface as exceptions or changed results. Add fixtures before rollout.array_find/array_all.grapheme_str_split).CURL_HTTP_VERSION_3, HTTP/3 experiments).*"This is a stability release, not a feature release — and that's the good news. v1.43.0 makes our polyfilled PHP 8.4 functions behave identically to native PHP 8.4, which is the whole point of our incremental upgrade strategy. Benefits:
mb_trim, Normalizer, and intl fixes stabilize multilingual input handling (critical for [Market X]).*"v1.43.0 (supersedes v1.38.1) is a parity/bugfix release — no new functions, no deprecations, no API removals. What changes:
mb_trim, Normalizer, uuid constants, odbc_connection_string_should_quote() now align with native PHP 8.4 behavior.grapheme_levenshtein() / grapheme_str_split() argument validation fixed — expect exceptions on invalid arguments where behavior was previously undefined.bcmath number validation fixed/stricter, matching native.Action Items:
"require": {
"symfony/polyfill-php84": "^1.43"
}
mb_trim(null) and mb_trim() on padded/normalized form inputs.Normalizer::normalize() on composed/decomposed and ill-formed UTF-8 payloads.grapheme_str_split('👨👩👧👦') plus invalid-argument cases (assert the new exceptions).bcadd/bccomp/bcdiv with user-supplied strings, including '', '1,5', '1e3', and leading +.if (version_compare(PCRE_VERSION, '10.44') < 0) {
Log::warning('PCRE <10.44: grapheme_str_split may fail.');
}
#[Deprecated] usage unchanged — no migration needed for existing tags.*"This release improves behavioral consistency in input handling:
Normalizer and intl ill-formed UTF-8 handling now match the native extension, reducing divergence risk in validation and sanitization paths (relevant to Unicode-based bypass and injection testing).bcmath validation means malformed numeric input is rejected rather than coerced — a net security gain for financial and quota logic.odbc_connection_string_should_quote() alignment hardens connection-string construction.#[Deprecated] support is unchanged and continues to align with PSR-style deprecation practice.
Recommendation: Approve for production. Prioritize regression testing on any endpoint that sanitizes user-supplied Unicode or parses user-supplied numbers, then roll out broadly."*"array_find/array_all behavior is unchanged in v1.43.0 — existing dashboard and role-filtering optimizations remain valid:
$admin = array_find($users, fn($u) => $u['role'] === 'admin');
What to watch: bcmath validation is now stricter, so any analytics pipeline feeding loosely-typed numeric strings into bc* functions may see new rejections or changed results. Audit ETL/job code that parses monetary or metric values from CSVs, spreadsheets, or user exports, and add fixtures for edge cases ('', '1,5', '1e3', leading +).
Use Case: Re-run [Analytics Dashboard] aggregation jobs in staging before promoting; expect no change for cleanly-typed inputs."
*"Key considerations:
grapheme_str_split); no new extensions, no new services.Normalizer parity are the only observable changes — monitor validation-error rates and 4xx/5xx on form and payment endpoints after deploy./api/users and payment/checkout paths for one cycle, then promote to production."How can I help you explore Laravel packages today?