symfony/polyfill-php72
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Symfony/polyfill-php72 is an invaluable package that backports PHP 7.2 core functions, constants, as well as some mbstring functions to lower PHP versions. This means that it offers the possibility of using these PHP 7.2 features even if the server runs on a previous PHP version. This package also provides support to Windows systems through the sapi_windows_vt100_support function and backports the utf8_encode and utf8_decode functions that were moved to core since PHP 7.2.
Utilizing the symfony/polyfill-php72 package is straightforward. Firstly, you will need to install it via composer by running the command composer require symfony/polyfill-php72
. Once the installation is complete, you can directly use the PHP 7.2 functions, constants, and the likes in your code as if you were already running PHP 7.2. For instance,
$spl_object_id = spl_object_id($object); // Using the spl_object_id function
$char = mb_chr($codepoint); // Using the mb_chr function
$os_family = PHP_OS_FAMILY; // Using PHP_OS_FAMILY constant
Note that you do not need to require or import anything into your PHP files, Polyfills are made available globally by Composer's autoloader.
Any documentation related to the symfony/polyfill-php72 package can be found in the main Polyfill README file. More comprehensive and updated information regarding the backported PHP 7.2 features, functions, constants, as well as their usage and implementation are available there. Visit the main Polyfill README documentation at https://github.com/symfony/polyfill/blob/main/README.md.