Use PHP 7.2 functions like spl_object_id in a project that must still support PHP 7.0 or 7.1 servers.
Automatically receive PHP 7.2 compatibility as a transitive dependency when using modern Symfony components.
Clean up multibyte string encoding issues with mb_scrub without writing PHP-version-check code yourself.
This package is a polyfill for PHP 7.2. A polyfill is a piece of code that fills in missing functionality, so that code written for a newer version of a language can still run on an older version. If you have a project that runs on PHP 7.0 or 7.1 and you want to use functions that were introduced in PHP 7.2, this package provides those functions so they are available even on the older version. The specific functions it covers are small but sometimes needed. On any PHP installation it provides spl_object_id, which returns a unique integer identifier for a given object, and stream_isatty, which checks whether a given stream is connected to a terminal. It also provides several multibyte string functions: mb_ord and mb_chr for converting between characters and their numeric code points, and mb_scrub for cleaning up invalid byte sequences in a string. Two text encoding functions, utf8_encode and utf8_decode, are included because in PHP 7.2 they were moved into the core from an optional extension. On Windows specifically, a function for controlling terminal color support is also provided. The package also defines several PHP 7.2 numeric constants related to floating-point precision and the name of the operating system family. This is part of the larger Symfony project, which is a set of PHP components widely used to build web applications. The polyfill is typically pulled in automatically as a dependency of other Symfony packages or third-party libraries that want to support a range of PHP versions without writing version-check code themselves. It is released under the MIT license. The README is short by design because the package itself is narrow in scope.
← symfony on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.