The Symfony Polyfill / PHP 7.2 Component
This component provides some PHP 7.2 features to applications using earlierPHP versions.
Installation
- $ composer require symfony/polyfill-php72
Note
If you install this component outside of a Symfony application, you mustrequire the vendor/autoload.php
file in your code to enable the classautoloading mechanism provided by Composer. Readthis article for more details.
Usage
Once this component is installed in your application, you can use the followingconstants and functions, no matter if your PHP version is earlier than PHP 7.2.
Provided Constants
PHP_OS_FAMILY
(value = depends on your operating system)
Provided Functions
sapi_windows_vt100_support
(only on Windows systems)spl_object_id
stream_isatty
utf8_decode
utf8_encode