llaville / php-compatinfo

Library that find out the minimum version and the extensions required for a piece of code to run
https://llaville.github.io/php-compatinfo/7.1/
Other
373 stars 20 forks source link

Usage of deprecated `each()` function in current stable release #242

Closed jrfnl closed 5 years ago

jrfnl commented 6 years ago

When running this package on PHP 7.2, the following deprecation warning is being thrown:

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in phar://phars/phpcompatinfo-5.0.12.phar/src/Bartlett/CompatInfo/Analyser/CompatibilityAnalyser.php on line 151

Call Stack:
    0.0110     731560   1. {main}() C:\wamp\bin\php\php5.4.20\phars\phpcompatinfo-5.0.12.phar:0
    0.0170     743616   2. require('phar://phars/phpcompatinfo-5.0.12.phar/bin/phpcompatinfo') C:\wamp\bin\php\php5.4.20\phars\phpcompatinfo-5.0.12.phar:45
    0.1640    2913544   3. Bartlett\CompatInfo\Console\Application->run() phar://phars/phpcompatinfo-5.0.12.phar/bin/phpcompatinfo:51
    0.1820    3237704   4. Bartlett\CompatInfo\Console\Application->run() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/Application.php:243
    0.1820    3237704   5. Bartlett\CompatInfo\Console\Application->doRun() phar://phars/phpcompatinfo-5.0.12.phar/vendor/symfony/console/Application.php:117
    0.1820    3237704   6. Bartlett\CompatInfo\Console\Application->doRun() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/Application.php:268
    0.1820    3237704   7. Bartlett\CompatInfo\Console\Application->doRunCommand() phar://phars/phpcompatinfo-5.0.12.phar/vendor/symfony/console/Application.php:193
    0.1880    3280136   8. Bartlett\Reflect\Console\Command->run() phar://phars/phpcompatinfo-5.0.12.phar/vendor/symfony/console/Application.php:861
    0.1890    3281192   9. call_user_func:{phar://phars/phpcompatinfo-5.0.12.phar/vendor/symfony/console/Command/Command.php:240}() phar://phars/phpcompatinfo-5.0.12.phar/vendor/symfony/console/Command/Command.php:240
    0.1890    3281192  10. Bartlett\Reflect\Console\CommandFactory->Bartlett\Reflect\Console\{closure}() phar://phars/phpcompatinfo-5.0.12.phar/vendor/symfony/console/Command/Command.php:240
    0.2100    3744544  11. call_user_func_array:{phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/CommandFactory.php:308}() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/CommandFactory.php:308
    0.2100    3744896  12. Bartlett\Reflect\Api\Analyser->run() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/CommandFactory.php:308
    0.2100    3745168  13. Bartlett\Reflect\Api\Analyser->request() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Api/Analyser.php:81
    0.2100    3745168  14. Bartlett\Reflect\Client\LocalClient->request() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Api/BaseApi.php:76
    0.2120    3789440  15. call_user_func_array:{phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Client/LocalClient.php:91}() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Client/LocalClient.php:91
    0.2120    3789792  16. Bartlett\Reflect\Api\V3\Analyser->run() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Client/LocalClient.php:91
    0.3280    4964296  17. Bartlett\Reflect->parse() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Api/V3/Analyser.php:110
    2.3911    8833056  18. PhpParser\NodeTraverser->traverse() phar://phars/phpcompatinfo-5.0.12.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect.php:321
    2.3911    8833056  19. Bartlett\CompatInfo\Analyser\CompatibilityAnalyser->beforeTraverse() phar://phars/phpcompatinfo-5.0.12.phar/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:59
    2.3951    8834792  20. each() phar://phars/phpcompatinfo-5.0.12.phar/src/Bartlett/CompatInfo/Analyser/CompatibilityAnalyser.php:151
llaville commented 6 years ago

Thanks for reporting. Even if support to PHP 7.2 is not warranty !

jrfnl commented 6 years ago

Even if support to PHP 7.2 is not warranty !

I get that, but as the package is about cross-version compat, it kind of felt like it should lead by example :wink:

llaville commented 6 years ago

Of course, but be aware that this package exists since a long time (and of long time before PHP 7.2). I warranty compatibility of all versions until 7.1 that is still a great effort. Add support to PHP 7.2 and futur 7.3 will pass by a full rewrite that will also simplify and improve performances.

Just for Information.

jrfnl commented 6 years ago

Respect :+1:

llaville commented 5 years ago

@jrfnl With latest version 5.2.0, PHP 7.2 is now supported (removed each usage : see commit https://github.com/llaville/php-compat-info/commit/6ec58efb188adbbfd117d33d1bb5f113aace22f8)

5.6 / 7.1 / 7.2 / 7.3 are now all supported - see test reports on ROADMAP

jrfnl commented 5 years ago

@llaville Great news :+1:

llaville commented 5 years ago

@jrfnl glad you appreciate !