symfony/polyfill-php70
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The Symfony Polyfill Php70 is a PHP component designed to backport certain PHP 7.0+ features to lower PHP versions which might lack them, thereby ensuring consistency and functionality across different PHP versions. The features covered include the intdiv() function, preg_replace_callback_array() function, error_clear_last function, random_bytes and random_int capabilities, Throwable Error classes, the PHP_INT_MIN constant, and the SessionUpdateTimestampHandlerInterface.
To use Symfony Polyfill Php70, all you have to do is include the desired feature via the use-statement in your PHP code. For instance, if you need to use the error_clear_last functionality which might not be present in your PHP version, you import it as follows:
use Symfony\Polyfill\Php70 as p;
$clear_error_last = p\error_clear_last();
Notably, to ensure your code is portable between PHP5 and PHP7, you have to code with caution; especially where *Error
exceptions must be caught before \Exception
; and after calling error_clear_last()
, you should verify the result of $e=error_get_last()
using isset($e['message'][0])
instead of the null!==$e
.
The documentation for Symfony Polyfill Php70 is not directly provided in an individual page; rather, it's found within the main README of the Symfony Polyfill on GitHub. Users can access comprehensive information and usage guidelines by visiting the main Symfony Polyfill README on GitHub. This README gives an overview of all the polyfills provided by Symfony, offering a handy reference and guide.