php-ref icon indicating copy to clipboard operation
php-ref copied to clipboard

PHP8 adaptations

Open kerunaru opened this issue 5 years ago • 0 comments

Depending of which PHP version is running, a slightly different code is executed in order to adapt the code to the deprecations of ReflectionParameter::isArray() and ReflecionParameter::getClass().

I've based the modifications on the suggestions in this article on PHP.Watch

I've modified the is7 key because I need it to refer to PHP 7 only. The way it was implemented before, although I'm on PHP 8, it keeps returning 1. So now it checks if the current version is higher than 7 but lower than 8. I've also created an is8 key just to check if the current version is equals or higher than 8. The resulting code should be retrocompatible.

P.S.: Sorry for the trailing whitespaces deletions 😅

kerunaru avatar Dec 28 '20 20:12 kerunaru