symfony/polyfill
Symfony polyfills backporting features to lower PHP versions
v1.41.0
4.8M downloads/mo
#2947 most downloaded on Packagist
symfony/polyfill
What this package is like to depend on
Last release 26 days ago
28 Jul 2026
Release timing varies
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 52 of 52 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
52 releases · first in 2015
10 releases in the last 12 months
see the full history below
Release timeline
52 releases · Nov 2015 to Jul 2026Releases
latest 52-
v1.41.028 Jul 2026Release notes
Open source →Changelog (v1.40.0...v1.41.0)
- bug #641 [Grapheme] Reject out-of-range offsets in the grapheme_str[ri]?pos() family (@nicolas-grekas)
- feature #612 [IoPoll] Polyfill the Io\Poll API (@nicolas-grekas)
- bug #637 [Php83][Php85][Grapheme] Throw ValueError on PHP 7 for functions that never returned false (@nicolas-grekas)
- minor #638 [Intl][Icu] Avoid pulling deprecated symfony/intl 5.4 on PHP < 8.1 (@nicolas-grekas)
- bug #640 [Php74] Align mb_str_split() polyfill with Mbstring and native (@nicolas-grekas)
- minor #639 Document the polyfill design principles (@nicolas-grekas)
Release notes
Open source →- Add polyfill for the
Io\PollAPI andStreamPollHandle- Throw
ValueErroron PHP 7 forjson_validate(),str_increment(),str_decrement(),grapheme_str_split()andgrapheme_levenshtein() - Reject out-of-range offsets in the
grapheme_str[ri]?pos()family - Align the Php74
mb_str_split()polyfill with Mbstring and native
- Throw
-
v1.40.012 Jun 2026Release notes
Open source →Changelog (v1.39.0...v1.40.0)
- bug #635 [DeepClone] Suggest the extension when refusing a named callable, and decode its global-function references (@nicolas-grekas)
- feature #634 [DeepClone] Gate closures over named callables behind an allow_named_closures option (@nicolas-grekas)
Release notes
Open source →- Gate deepcloning closures over named callables behind an
$allow_named_closuresoption- Suggest ext-deepclone when refusing a named callable, and decode its global-function references
-
v1.39.010 Jun 2026Release notes
Open source →Changelog (v1.38.2...v1.39.0)
- feature #630 [DeepClone] Support closures declared in constant expressions (@nicolas-grekas)
- bug #632 [DeepClone] Fix round-tripping short-lived Random\Randomizer instances on PHP 8.2 (@nicolas-grekas)
- bug #631 [DeepClone] Reject from_array payloads that would build an uninitialized object (@nicolas-grekas)
Release notes
Open source →- Support closures declared in constant expressions
- Fix round-tripping short-lived
Random\Randomizerinstances on PHP 8.2 - Reject
deepclone_from_array()payloads that would build an uninitialized object
- Fix round-tripping short-lived
-
v1.38.208 Jun 2026Release notes
Open source →Changelog (v1.38.1...v1.38.2)
- bug #629 [DeepClone] Fix round-tripping objects whose __serialize() nests another object (@nicolas-grekas)
- bug #628 [DeepClone] Fix round-tripping and hydrating BcMath\Number (@nicolas-grekas)
- bug #627 [DeepClone] Reject malformed deepclone_from_array() input without warnings (@nicolas-grekas)
- bug #626 [DeepClone] Fix cloning objects with numeric property names (@nicolas-grekas)
- bug #623 [Mbstring] Fix issues with mb_scrub() (@GPHemsley)
- bug #622 [Mbstring][Php3] Fix issues with mb_str_pad() (@GPHemsley)
Release notes
Open source →- Fix round-tripping objects whose
__serialize()nests another object- Fix round-tripping and hydrating
BcMath\Number - Reject malformed
deepclone_from_array()input without warnings - Fix cloning objects with numeric property names
- Fix issues with
mb_scrub() - Fix issues with
mb_str_pad()
- Fix round-tripping and hydrating
-
v1.38.126 May 2026Release notes
Open source →Changelog (v1.38.0...v1.38.1)
- security #cve-2026-46644 [Intl][Idn] Reject xn-- labels whose Punycode payload decodes to ASCII-only (@nicolas-grekas)
- bug #619 [Mbstring][Php83][Php84] Isolate PHP 7 mb_* declarations into bootstrap72.php (@nicolas-grekas)
- bug #617 Polyfill more cURL constants (@GPHemsley)
- bug #618 fix: Correctly define MySQL constants (@mitelg)
- bug #616 Fix grapheme_str_split() on PCRE 8 (@GPHemsley)
- bug #615 Fix newline handling in Php74 implementation of mb_str_split() (@GPHemsley)
Release notes
Open source →- CVE-2026-46644
idn_to_ascii()/idn_to_utf8(): rejectxn--labels whose Punycode payload decodes to ASCII-only- Fix
grapheme_str_split()on PCRE 8 - Fix
mb_str_split()newline handling in the Php74 polyfill - Fix
grapheme_levenshtein()delegation in the Intl/Grapheme polyfill - Make
mb_*polyfills match the nativestringreturn type on PHP 8+ - Fix missing
CURLOPT_ISSUERCERT_BLOBandCURLOPT_SSH_HOST_PUBLIC_KEY_SHA256constants - Fix definition of MySQL PDO constants
- Fix
-
v1.38.025 May 2026Release notes
Open source →Changelog (v1.37.0...v1.38.0)
- bug #582 [Intl/MessageFormatter] Add missing parseMessage() method (@xabbuh)
- bug #610 [Mbstring] Fall back to plain iconv when //IGNORE is unsupported (on musl) (@nicolas-grekas)
- bug #609 [Intl/MessageFormatter] Validate the full pattern at configuration time (@nicolas-grekas)
- feature #608 [Intl/Normalizer] Polyfill normalizer_get_raw_decomposition() (@nicolas-grekas)
- bug #607 [Mbstring] Make mb_convert_encoding($s, $y, 'HTML-ENTITIES') match native output (@nicolas-grekas)
- bug #603 [Mbstring][Php83][Php84] Accept null in mb_* polyfills (@nicolas-grekas)
- bug #600 [Php84] Declare $persistent property in ReflectionConstant stub (@nicolas-grekas)
- bug #599 [Php83] Fix mb_str_pad invalid encoding error reporting (@nicolas-grekas)
- bug #604 [Grapheme] Return false from grapheme_strrev() on invalid UTF-8 (@nicolas-grekas)
- bug #598 [Grapheme] Fix grapheme cluster splitting on PCRE < 10.44 (@nicolas-grekas)
- bug #596 [Mbstring] Fix mb_strlen() for invalid UTF-8 input (@nicolas-grekas)
- bug #595 [Php83] Fix str_increment() for numeric strings beyond PHP_INT_MAX (@nicolas-grekas)
- bug #594 [Php83] Fix ldap_exop_sync polyfill on PHP < 8.3 (@nicolas-grekas)
- bug #591 Fix mb_rtrim() missing unicode-awareness (@nicolas-grekas)
- bug #590 PHP can be built without PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT (@alexpott)
- bug #588 Update
IntlDateFormatter::__construct()parameters (@Seb33300)
Release notes
Open source →- Add polyfill for
normalizer_get_raw_decomposition()- Add missing
IntlMessageFormatter::parseMessage()method - Sync currencies metadata with
symfony/intldata - Mark
UUID_TYPE_DCEandUUID_TYPE_NAMEas deprecated on PHP 8.5+ - Validate
MessageFormatterpatterns at configuration time - Accept null in
mb_*polyfills - Fall back to plain
iconv()when//IGNOREis unsupported (e.g. on musl) - Improve type declarations of some mbstring polyfills
- Make
mb_convert_encoding($s, $y, 'HTML-ENTITIES')match native output - Update
IntlDateFormatter::__construct()parameters - Fix
grapheme_strrev()to return false on invalid UTF-8 - Fix grapheme cluster splitting on PCRE < 10.44
- Fix
mb_strlen()for invalid UTF-8 input - Fix
mb_rtrim()missing unicode-awareness - Fix
mb_str_pad()invalid encoding error reporting - Fix
str_increment()for numeric strings beyondPHP_INT_MAX - Fix
ldap_exop_sync()polyfill on PHP < 8.3 - Fix
ReflectionConstantstub to declare its$persistentproperty - Fix detection of
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERTwhen PHP is built without it
- Add missing
-
v1.37.026 Apr 2026Release notes
Open source →Changelog (v1.36.0...v1.37.0)
- feature #578 [RFC] Add grapheme_strrev function php 8.6 (@PhilDaiguille)
- bug #580 Fix
grapheme_levenshtein()registration in polyfill-php85 (@xabbuh) - bug #581 do not register the locale_is_right_to_left() function without the intl extension (@xabbuh)
- bug #584 [DeepClone] Drop SPL "\0" special key from deepclone_hydrate() (@nicolas-grekas)
- bug #577 [DeepClone] Cap IS_LONG objectMeta count at 1M (@nicolas-grekas)
- feature #576 [DeepClone] Drop scoped mode — mangled-only is now the only shape (@nicolas-grekas)
- feature #574 [DeepClone] Add DEEPCLONE_HYDRATE_PRESERVE_REFS flag + hot-path perf (@nicolas-grekas)
Release notes
Open source →- Add polyfill for
grapheme_strrev()- Compat with deepclone v0.6.0
- Fix
locale_is_right_to_left()registration in polyfill-php85 - Fix
grapheme_levenshtein()registration in polyfill-php85
-
v1.36.015 Apr 2026Release notes
Open source →Changelog (v1.35.0...v1.36.0)
- feature #573 [DeepClone] Mirror ext v0.3.0: $flags parameter + forgiving-hydrate behaviors (@nicolas-grekas)
- bug #572 [DeepClone] Fix PHP warning for
__sleep()-listed uninitialized declared properties (@nicolas-grekas)
-
v1.35.014 Apr 2026Release notes
Open source →Changelog (v1.34.0...v1.35.0)
- bug #571 [DeepClone] Fix cache poisoning causing spurious NotInstantiableException (@nicolas-grekas)
- feature #569 [PHP 8.6] Add SortDirection enum for PHP 8.1+ (@Ayesh)
- feature #566 [PHP 8.6] Add
ARRAY_FILTER_USE_VALUEconstant (@Ayesh) - feature #568 [DeepClone] Add deepclone_hydrate() polyfill (@nicolas-grekas)
Release notes
Open source →- Add polyfill for
deepclone_hydrate()- Add polyfill for
ARRAY_FILTER_USE_VALUEconstant - Add polyfill for the
SortDirectionenum - Fix cache poisoning in
DeepClonepolyfill
- Add polyfill for
-
v1.34.010 Apr 2026Release notes
Open source →Changelog (v1.33.0...v1.34.0)
- bug #565 Fix bcdiv handling of DivisionByZeroError (@nicolas-grekas)
- bug #501 mbstring polyfills must not raise value errors in PHP 7 (@derrabus)
- feature #527 [8.5] Add
locale_is_right_to_left(@alexander-schranz) - feature #532 [Intl] Add PHP 8.5
IntlListFormatterto ICU polyfill (@Ayesh) - feature #549 Add polyfill for PDO driver specific subclasses (@nicolas-grekas, @jnoordsij)
- feature #558 Add the grapheme_levenshtein polyfill (Sudam Ranasinghe)
- feature #557 [PHP 8.5] Add new
\Filter\FilterExceptionandFilter\FilterFailedException(@Ayesh) - feature #560 Add fallback implementation for Collator::compare() (@aymericcucherousset)
- bug #556 Fix PHP 7.2 compatibility for PHP 8.4 polyfill (@Seldaek)
- feature #561 Add polyfill for symfony/php-ext-deepclone (@nicolas-grekas, @GromNaN)
- feature #554 [8.6] Add
clampfunction (@kylekatarnls) - feature #546 [8.4] implement bcround, bcceil and bcfloor (@Dean151)
- bug #504 Ctype: Give the correct deprecations for PHP 8.1+ (@BackEndTea)
- feature #541 [8.5] Add polyfill for DelayedTargetValidation (@DanielEScherzer)
Release notes
Open source →- Add polyfill for the
symfony/deepcloneextension- Add polyfill for
clamp() - Add polyfill for
bcround(),bcceil()andbcfloor() - Add polyfill for
grapheme_levenshtein() - Add polyfill for
#[DelayedTargetValidation] - Add polyfill for
Filter\FilterExceptionandFilter\FilterFailedException - Add polyfill for
IntlListFormatterto ICU polyfill - Add polyfill for
locale_is_right_to_left() - Add polyfill for PDO driver specific subclasses
- Fix PHP 8.5 deprecations
- Fix ctype deprecations on PHP 8.1+
- Fix PHP 7.2 compatibility of the
#[Deprecated]polyfill - Fix mbstring polyfill must not raise value errors on PHP 7
- Fix
bcdiv()handling ofDivisionByZeroError
- Add polyfill for
-
v1.33.019 Aug 2025Release notes
Open source →- Add polyfill for
ReflectionConstant- Add polyfill for
bcdivmod() - Add polyfill for
grapheme_str_split() - Add polyfills for
array_first()andarray_last() - Fix
json_validate()with properties containing a NUL byte
- Add polyfill for
- Add polyfill for
-
v1.32.002 May 2025Release notes
Open source →- Remove the PHP 7.2 polyfill
- Polyfill
#[\NoDiscard] - Polyfill
fpow - Polyfill
get_error_handler()andget_exception_handler() - Fix
mb_rtrimfor UTF-8 text - Fix Curl constants being redefined in PHP 8.4 polyfill
- Polyfill
- Remove the PHP 7.2 polyfill
-
v1.31.009 Sep 2024Release notes
Open source →- Bump minimum PHP version to 7.2
- Polyfill
mb_trim,mb_ltrimandmb_rtrim - Polyfill
CURL_HTTP_VERSION_3(ONLY)constants
- Polyfill
- Bump minimum PHP version to 7.2
-
v1.30.019 Jun 2024Release notes
Open source →- Polyfill
array_find,array_find_key,array_anyandarray_all- Polyfill
mb_ucfirstandmb_lcfirst - Fix
mb_convert_encodingto accept an array of strings - Update nullable types for PHP 8.4
- Polyfill
- Polyfill
-
v1.29.029 Jan 2024Release notes
Open source →- Fix the
ini_parse_quantity()polyfill- Add
str_incrementandstr_decrementfunctions - Add
SQLite3Exceptionclass
- Add
- Fix the
-
v1.28.025 Aug 2023Release notes
Open source →- Polyfill
ldap_exop_sync()- Polyfill
ldap_connect_wallet() - Polyfill
stream_context_set_options() - Polyfill
odbc_connection_string_is_quoted() - Polyfill
odbc_connection_string_should_quote() - Polyfill
odbc_connection_string_quote() - Polyfill
ini_parse_quantity() - Polyfill
mb_str_pad() - Polyfill
#[\Override]attribute - Use full case folding when using
MB_CASE_FOLD - Add
CURLStringFileclass introduced in PHP 8.1 (but only if PHP >= 7.4 is used) - Add
Date*Exception/Errorclasses introduced in PHP 8.3 for the Date/Time extension
- Polyfill
- Polyfill
-
v1.27.010 Nov 2022Release notes
Open source →- Add PHP 8.3 polyfill for
json_validate()- Add polyfill for PHP 8.2's
Randominterfaces, exceptions andSecureengine - Fix
IntlDateFormatter::formatObject()signature
- Add polyfill for PHP 8.2's
- Add PHP 8.3 polyfill for
-
v1.26.002 Jun 2022Release notes
Open source →- Add PHP 8.2 polyfill with SensitiveParameter, SensitiveParameterValue and AllowDynamicProperties
- Fix QQQQQ date format
- Fix passing null to
preg_split(), throwing a deprecation on PHP 8.1
- Add PHP 8.2 polyfill with SensitiveParameter, SensitiveParameterValue and AllowDynamicProperties
-
v1.25.004 Mar 2022Release notes
Open source →- Add
PhpTokento the PHP 8.0 polyfill when the tokenizer extension is enabled- Fix
str_ends_with()when needle is longer than haystack
- Fix
- Add
-
v1.24.004 Jan 2022Release notes
Open source →- Indicates that polyfills provides corresponding extensions
- Add
IntlDateFormatter::RELATIVE_*constants - Mimic deprecation from PHP 8.1 in IntlDateFormatter
- Optimize
array_is_list - Workaround buggy PCRE versions
- Fix
iconv_mime_decode()while using mbstring extension - Fix deprecations on PHP 8.1
- Fix Intl Grapheme
PCRE_VERSIONcomparison when version has a timestamp - Fix throwing from
mb_substitute_characteron PHP >= 8
- Add
- Indicates that polyfills provides corresponding extensions
-
v1.23.129 Jul 2021 -
v1.23.027 May 2021Release notes
Open source →- added
CURLStringFileto the PHP 8.1 polyfill- added
enum_exists()to the PHP 8.1 polyfill - added
MYSQLI_REFRESH_REPLICAconstant to PHP 8.1 polyfill - added
ReturnTypeWillChangeto PHP 8.1 polyfill - updated Unicode maps to v13
- removed
INTL_IDNA_VARIANT_2003on PHP 8 - fixed return value of
mb_parse_str() - fixed
IntlDateFormatter::format()on 32b platforms - fixed
mb_chr()in the PHP 7.2 polyfill - fixed
mb_strrchr(),mb_detect_order(),iconv_substr(),grapheme_substr()on PHP 8
- added
- added
-
v1.22.115 Feb 2021 -
v1.22.007 Jan 2021Release notes
Open source →- added PHP 8.1 polyfill
- fixed signatures on PHP 8
- fixed behaviors on PHP 8
- synced values of
Normalizer::*consts
- added PHP 8.1 polyfill
-
v1.20.024 Oct 2020 -
v1.19.023 Oct 2020Release notes
Open source →- Add a polyfill for the
Attributeclass- Fix the name of arguments for PHP 8
- Improve performances of
array_key_last() - Fix polyfill for
mb_strrchr() - Skip loading
Stringableon PHP 8 - Fix passing
$length=nulltographeme_substr() - Fix
iconv_substr()andgrapheme_substr()on PHP 8 - Fix using any IDNA constants
- Add a polyfill for the
-
v1.18.104 Aug 2020Release notes
Open source →- Don't force labels containing URL delimiters to stay in their Unicode form when using
idn_to_ascii()
- Don't force labels containing URL delimiters to stay in their Unicode form when using
-
v1.18.014 Jul 2020Release notes
Open source →- improve polyfill-idn to make it compliant with latest Unicode specs
- added
UnhandledMatchErrorto the PHP 8 polyfill
- added
- improve polyfill-idn to make it compliant with latest Unicode specs
-
v1.17.120 Jun 2020 -
v1.17.012 May 2020Release notes
Open source →- added
get_resource_id()to the PHP 8 polyfill- fix declaring extra constants when
intlis loaded
- fix declaring extra constants when
- added
-
v1.16.008 May 2020Release notes
Open source →- added
str_starts_with()andstr_ends_with()to the PHP 8 polyfill- added polyfill for
PHP_FLOAT_*constants - fixed
spl_object_id()on 32-bit systems - fixed
idn_to_ascii()not failing on leading or trailing hyphen-minus
- added polyfill for
- added
-
v1.15.025 Mar 2020Release notes
Open source →- added interface
Stringableto the PHP 8 polyfill- added
get_debug_type()to the PHP 8 polyfill - added
str_contains()to the PHP 8 polyfill - added
preg_last_error_msg()to the PHP 8 polyfill - added support for UUID V3 and V5
- added support for UUID on 32-bit systems
- fixed support for preloading
- added
- added interface
-
v1.14.013 Feb 2020 -
v1.13.213 Jan 2020Release notes
Open source →- use correct block size for SHA1 in
hash_pbkdf2()polyfill- fixed
mb_str_split()ignoring new-line characters - updated Unicode maps
- fixed
- use correct block size for SHA1 in
-
v1.13.130 Nov 2019 -
v1.13.027 Nov 2019Release notes
Open source →- added polyfills for
uuid_*functions- optimized
mb_str_split() - fixed handling negative offsets for grapheme and mbstring functions
- optimized
- added polyfills for
-
v1.12.006 Aug 2019 -
v1.11.022 Mar 2019Release notes
Open source →- fixed support for IDN with trailing dot
- added missing polyfill for
JsonException
- added missing polyfill for
- fixed support for IDN with trailing dot
-
v1.10.031 Oct 2018Release notes
Open source →- added polyfill for
idn_to_ascii()andidn_to_utf8()- added polyfill for intl's
MessageFormatter - prevented DoS via long passwords when using
hash_pbkdf2()polyfill - duplicated
mb_ord(),mb_chr()andmb_scrub()polyfills in thephp72one
- added polyfill for intl's
- added polyfill for
-
v1.9.006 Aug 2018Release notes
Open source →- added polyfill for
hrtime()- added polyfills for
array_key_first()andarray_key_last() - fixed infinite loop in
iconv()polyfill when using translit mode - fixed converting to title case with mbstring polyfill
- added polyfills for
- added polyfill for
-
v1.8.001 May 2018 -
v1.7.031 Jan 2018Release notes
Open source →- added logic to new stream functions on Windows (sapi_windows_vt100_support)
- added polyfills for mb_*_numericentity
- made translit/ignore flags order-insensitive
- added logic to new stream functions on Windows (sapi_windows_vt100_support)
-
v1.6.011 Oct 2017Release notes
Open source →- add
SessionUpdateTimestampHandlerInterfacein PHP 7.0 polyfill- fixed loading of Apcu polyfill when Zend Server's Data Cache is used
- add
-
v1.5.016 Aug 2017Release notes
Open source →- added polyfill for spl_object_id()
- fixed apcu function when apc ones are polyfilled with Zend Server's Data Cache
- added
PHP_OS_FAMILYpolyfill
- added polyfill for spl_object_id()
-
v1.4.009 Jun 2017 -
v1.3.109 Jun 2017Release notes
Open source →- added missing validation to mb_convert_case()
- added missing PHP_INT_MIN constant
- fixed iconv_substr(): Detected an illegal character in input string
- provided APCUIterator for APCu 4.x users
- added missing validation to mb_convert_case()
-
v1.3.014 Nov 2016Release notes
Open source →- added polyfill for
is_iterable()- added polyfills for
mb_chr(),mb_ord()andmb_scrub() - added support for PHP 7.1
- silenced
iconv_strlen()inmb_strlen()polyfill - bypassed iconv for some charsets in mb_strlen
- fixed
mb_convert_variables()poylfill
- added polyfills for
- added polyfill for
-
v1.2.018 May 2016Release notes
Open source →- bug #61 Normalizer::decompose() should reorder "recursive" combining chars (nicolas-grekas)
- bug #59 Normalizer::recompose() should reset the last combining class on ASCII (nicolas-grekas)
- bug #59 Normalizer::isNormalized() should fail with Normalizer::NONE (nicolas-grekas)
- bug #59 Normalizer::isNormalized() and ::normalize() should check for multibyte string function overload (nicolas-grekas)
- feature #44/#53 allow paragonie/random_compat 2.0 (ickbinhier)
- feature #51 Use plain PHP for data maps to benefit from OPcache on PHP 5.6+ (nicolas-grekas)
- bug #49 Fix hex2bin return null (fuhry, binwiederhier)
- bug #61 Normalizer::decompose() should reorder "recursive" combining chars (nicolas-grekas)
-
v1.1.103 Mar 2016Release notes
Open source →- bug #40 [Apcu] Load APCUIterator only when APCIterator exists (nicolas-grekas)
- bug #37 [Iconv] Fix wrong use in bootstrap.php (tucksaun)
- bug #31 Fix class_uses polyfill (WouterJ)
- bug #40 [Apcu] Load APCUIterator only when APCIterator exists (nicolas-grekas)
-
v1.1.025 Jan 2016Release notes
Open source →- feature #22 [APCu] A new polyfill for the legacy APC users (nicolas-grekas)
- bug #28 [Php70] Workaround https://bugs.php.net/63206 (nicolas-grekas)
- feature #22 [APCu] A new polyfill for the legacy APC users (nicolas-grekas)
-
v1.0.118 Dec 2015Release notes
Open source →- bug #14 ldap_escape does not encode leading/trailing spaces. (ChadSikorra)
- bug #17 Fix #16 - gzopen() / gzopen64() - 32 bit builds of Ubuntu 14.04 (fisharebest)
- bug #14 ldap_escape does not encode leading/trailing spaces. (ChadSikorra)
-
v1.0.004 Nov 2015