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.
Assessment revision: v1.43.0 (updated from v1.38.0). This release is a stabilization release composed entirely of bug fixes and internal test-harness changes — no new polyfilled functions, no deprecations, no breaking changes to the public surface. Its significance for a TPM is that it retires several of the specific risks flagged in the prior assessment (polyfill behavior drift, mb_trim edge cases, grapheme_* argument validation, BCMath numeric validation, and UTF-8 handling parity with intl). Risk posture moves from "adopt with caution and write parity tests" to "adopt; parity tests now serve as regression guards rather than discovery tools."
array_find/array_all can replace or augment Laravel's Collection methods (e.g., firstWhere, contains), reducing custom logic.mb_* fixes directly improve Laravel's Str::of(), App::setLocale(), and form validation for multibyte strings (e.g., emojis, CJK). v1.43.0 strengthens this: mb_trim() and the Normalizer polyfills are now explicitly aligned with native behavior, which directly de-risks Str::trim()-style chains and any Laravel validation rule relying on Unicode normalization (e.g., password/username normalization before persistence).odbc_connection_string_should_quote(), which matters only for teams using ODBC/DB2 drivers via Laravel's connector layer — a narrow but previously silent-failure path.#[Deprecated]) in Laravel 9/10 without forcing a PHP version bump, critical for teams constrained by hosting (e.g., shared servers).bcdivmod for financial calculations). Both of these areas received direct fixes in v1.43.0 — grapheme_levenshtein()/grapheme_str_split() argument validation, BCMath number validation, and intl UTF-8 ill-formed-input parity. The financial-calculation use case in particular is now materially safer to green-light."symfony/polyfill-php84": "^1.43". No Laravel-specific configuration required. Autoloading handles the rest.mb_trim() or grapheme_str_split() behavior should grep for those workarounds and remove them, since they will now double-apply.grapheme_str_split fix still requires PCRE ≥10.44 for full native parity. v1.43.0 tightened argument validation but did not relax the PCRE floor. Laravel TPMs should continue to audit hosting environments and keep the runtime check:
if (version_compare(PCRE_VERSION, '10.44') < 0) {
Log::warning('PCRE <10.44: grapheme_str_split polyfill unavailable.');
}
array_find/array_all are untouched in this release; previously verified parity with Collection::firstWhere holds.mb_trim(), Normalizer, odbc_connection_string_should_quote(), UUID constants, grapheme_levenshtein()/grapheme_str_split() argument validation, BCMath number validation, and intl ill-formed UTF-8 handling. The prior assessment's mitigation ("write unit tests and compare outputs with PHP 8.4") is now cheaper to satisfy and can be reframed as a standing regression suite rather than a discovery exercise.mb_trim for 20% of user-generated content in [Module X]").mb_trim(), custom validation around grapheme_str_split() argument handling, or BCMath input sanitizers — may now behave differently. This is a correctness improvement, not a regression, but it is a behavior change that must be surfaced in release notes to application teams.mb_trim/Normalizer/intl parity fixes.mb_trim(), grapheme_str_split(), or BCMath validation behavior? Inventory and schedule removal of compensating workarounds.odbc_connection_string_should_quote() behavior in staging.grapheme_str_split parity.mbstring) that might conflict?^1.43 and reviewing quarterly rather than drifting.HttpClient, StringUtils, or Validator, these polyfills are already expected dependencies.composer require symfony/polyfill-php84:^1.43
mb_trim(), Normalizer, grapheme_str_split() argument handling, or BCMath input validation.#[Deprecated] for Laravel custom packages:
#[Deprecated('Use App\Services\NewService instead')]
class LegacyService { ... }
mb_trim/mb_ucfirst suites with non-ASCII strings (Arabic, CJK) — expect more native-like output than before, not less.grapheme_str_split still needs PCRE ≥10.44 for full parity. Retain the runtime guard:
if (version_compare(PCRE_VERSION, '10.44') < 0) {
throw new RuntimeException('PCRE <10.44: grapheme_str_split polyfill unavailable.');
}
Collection methods but don't replace them entirely.^1.43, deploy to staging, and run the full suite. This is a low-risk patch bump and can proceed without feature work.^1.43 and adopt a standing quarterly review of symfony/polyfill-php84 releases. The gap from 1.38.1 to 1.43.0 (five minors) is a process signal: without a cadence, parity fixes accumulate unadopted.mb_trim/Normalizer divergence. This is a positive maintenance signal: the maintainers are treating "polyfill must match native" as a first-class contract.mb_trim, Normalizer, grapheme_* validation, BCMath validation, and intl UTF-8 handling. Residual risk is low and concentrated in undocumented edge cases.grapheme_str_split parity. Runtime guard remains mandatory.How can I help you explore Laravel packages today?