Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate PHP code coverage without Xdebug

I'm using Xdebug to get some coverage data during my unit tests, but it costs a lot of time (and memory).

Is there any way to get coverage without using Xdebug?

like image 368
Sylvain Avatar asked Dec 24 '22 19:12

Sylvain


1 Answers

As of PHP 7, you can use PHPDBG instead of Xdebug to collect code coverage information with PHPUnit. However, there will always be a resource penalty (time and memory) when code coverage information is collected.

like image 173
Sebastian Bergmann Avatar answered Dec 26 '22 17:12

Sebastian Bergmann