Test coverage on PHPUnit 6.5.5 and PHP 7.2

前端 未结 3 1825
名媛妹妹
名媛妹妹 2021-01-27 02:23

the problem is that lines with the switch case are not covered, the switch cases themselves are being executed.

Tested on windows

3条回答
  •  攒了一身酷
    2021-01-27 02:51

    The output is technically correct, as PHP 7.2 is now clever and no longer needs to run the case statements. I wrote about these optimisations at https://derickrethans.nl/php7.2-switch.html

    Nevertheless, this is unwanted behaviour, and hence Xdebug has this "bug" fixed with https://github.com/xdebug/xdebug/commit/0690bf83109228a67dfe14a9a312045435b7b774 — this is part of Xdebug's code on GitHub, but has not made it yet into a release. It will make it into Xdebug 2.6.0beta2.

提交回复
热议问题