Is there any code coverage tool available for PHP?
I wish to check the code coverage of my code and API's written in PHP, but have not been able to lay my hands on any code coverage tool for PHP, as it is more of a server side language and dynamic in nature.
Does anyone know of a method by which code coverage for PHP can be executed?
xdebug has Code Coverage Analysis.
Check this chapter of the PHPUnit Manual
See our PHP Test Coverage tool from Semantic Designs:
http://www.semanticdesigns.com/Products/TestCoverage/PHPTestCoverage.html
Very low overhead, handles huge systems of files, intuitive GUI showing coverage on specific files, and generated report with coverage breakdown at method, class and package levels.
Best of all, no requirement to install anything in the system being
tested. No need for xdebug, etc., which means you don't have to argue
with the sysadmin to do your testing.
You can use it with PHPUnit to get unit-test driven coverage. Or you can use it on your website to collect coverage from any functional testing approach/tools you may have.
Using Xdebug in combination with PHPUnit can give you code coverage analysis.
Spike PHPCoverage. Both SimpleTest and PHPUnit can easily be integrated with it, although PHPUnits support is there out-of-the-box.
Zend Studio ships with code coverage tools out the box.
Xdebug can do code coverage reporting, and Phing, a build utility, can automate running coverage reports (http://devzone.zend.com/article/2955).