View Issue Details

IDProjectCategoryView StatusLast Update
0000757XdebugUncategorizedpublic2012-02-29 13:12
Reportergnombat Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Summary0000757: XDEBUG_CC_UNUSED does not work with code outside a function
Description

For PHP code outside any function, XDEBUG_CC_UNUSED does not seem to work.

Steps To Reproduce

See the contents of the attached file.

If you run code-coverage-inside-function.php, it reports the line "$y = 3;" as uncovered. If you run code-coverage-outside-function.php, it does not have any information for the "$y = 3;" line.

TagsNo tags attached.
Operating SystemWindows, Linux
PHP Version5.3.8

Activities

derick

2012-02-29 13:12

administrator   ~0001933

This is "expected" behaviour. The dead code analysis can only run for new functions that are being created after start_code_coverage() has been run. I can't see a way on how to fix this. The best way would be to start/stop the coverage before you include a file, which is what I do in most of the Xdebug tests.