symfony/polyfill-php84
Symfony Polyfill for PHP 8.4 features on older runtimes. Adds functions like array_find/any/all, bcdivmod, fpow, grapheme_str_split, mb_* trim/ucfirst/lcfirst, Deprecated attribute, cURL HTTP/3 constants, PDO driver subclasses, and ReflectionConstant.
mb_* polyfills (e.g., mb_strlen(null)) and Unicode-aware string trimming (mb_rtrim) reduces edge-case failures in legacy codebases, accelerating migration confidence.mb_* functions on null inputs (e.g., user-generated data) without runtime errors.mb_rtrim() improves text processing for non-ASCII languages (e.g., CJK, Arabic).mb_* functions (e.g., multilingual apps) and encounters null input edge cases (now explicitly handled).mb_rtrim, mb_substr).HttpClient, StringUtils) that implicitly depend on these fixes.mb_* behavior beyond null handling/Unicode awareness (e.g., locale-specific trimming).grapheme_str_split in high-load paths).*"This update eliminates critical bugs in Symfony’s PHP 8.4 polyfills, making it safer and more reliable for legacy system modernization. Key wins:
mb_* functions (common in user-generated content) and PCRE compatibility (shared hosting).*"v1.38.0 closes critical gaps for real-world use:
mb_* functions now handle null inputs (e.g., mb_strlen(null) → 0 instead of errors). Useful for:
$length = mb_strlen($userInput ?? null); // No more crashes!
grapheme_str_split('👨👩👧👦')).MYSQL_ATTR_SSL_VERIFY_SERVER_CERT issues in MySQL connections.mb_rtrim() now drops trailing whitespace and non-breaking spaces (e.g., mb_rtrim('hello ') → 'hello').Action Items:
mb_* functions, PDO SSL paths, and grapheme-heavy code (e.g., emoji/emoji modifiers).composer.json:
"require": {
"symfony/polyfill-php84": "^1.38.0"
}
*"This release improves security and compliance by:
mb_* functions: Reduces risk of injection/edge-case exploits in multilingual input handling.How can I help you explore Laravel packages today?