symfony / polyfill-php70
Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
Fund package maintenance!
fabpot
Tidelift
symfony.com/sponsor
Installs: 187 798 278
Dependents: 58
Suggesters: 1
Security: 0
Stars: 3 220
Watchers: 6
Forks: 9
Type:metapackage
Requires
- php: >=7.1
README
This component provides features unavailable in releases prior to PHP 7.0:
intdiv
preg_replace_callback_array
error_clear_last
random_bytes
andrandom_int
(from paragonie/random_compat)*Error
throwable classesPHP_INT_MIN
SessionUpdateTimestampHandlerInterface
More information can be found in the main Polyfill README.
Compatibility notes
To write portable code between PHP5 and PHP7, some care must be taken:
\*Error
exceptions must be caught before\Exception
;- after calling
error_clear_last()
, the result of$e = error_get_last()
must be verified usingisset($e['message'][0])
instead ofnull !== $e
.
License
This library is released under the MIT license.