View Issue Details

IDProjectCategoryView StatusLast Update
0000757XdebugUncategorizedpublic2012-02-29 13:12
Reportergnombat Assigned Toderick  
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.
Attached Files
code-coverage.zip (700 bytes)
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.

Issue History

Date Modified Username Field Change
2011-12-02 02:54 gnombat New Issue
2011-12-02 02:54 gnombat File Added: code-coverage.zip
2012-02-29 13:12 derick Note Added: 0001933
2012-02-29 13:12 derick Status new => resolved
2012-02-29 13:12 derick Resolution open => not fixable
2012-02-29 13:12 derick Assigned To => derick
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized