View Issue Details

IDProjectCategoryView StatusLast Update
0002420XdebugCode Coveragepublic2026-04-29 09:43
Reportersebastian Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version3.5.1 
Summary0002420: Introduce separate flags for branch coverage and path coverage collection
Description

Currently, Xdebug provides a single flag, XDEBUG_CC_BRANCH_CHECK, which activates both branch coverage and path coverage collection simultaneously. I'd like to propose splitting this into two independent flags so that branch coverage and path coverage can be activated separately.

The current design only supports two scenarios:

  1. Line coverage only (no flag)
  2. Line coverage + branch coverage + path coverage (XDEBUG_CC_BRANCH_CHECK)

There is no way to enable branch coverage without also enabling path coverage. My assumption is that collecting branch coverage information alone is less resource-intensive than collecting both branch coverage and path coverage. Users who only need branch coverage currently have to pay the additional cost of path coverage collection, even if they do not make use of that data.

Splitting the flag would enable three scenarios:

  1. Line coverage only
  2. Line coverage + branch coverage
  3. Line coverage + branch coverage + path coverage

And technically also "line coverage + path coverage", but I do not see how this would be useful in practice.

I would like to propose two new flags:

  • XDEBUG_CC_BRANCH_COVERAGE to activate branch coverage
  • XDEBUG_CC_PATH_COVERAGE to activate path coverage

I am not sure whether or not XDEBUG_CC_PATH_COVERAGE should also activate branch coverage.
I am aware that the "_CC" infix and the "_COVERAGE" suffix carry redundant information, so the names are not ideal. I have not come up with better names yet, sorry.

In a perfect world, the existing XDEBUG_CC_BRANCH_CHECK flag would be redefined to mean "activate branch coverage only". However, this would be a backward-compatibility break for existing users who rely on its current behaviour of also activating path coverage. To avoid that, I propose the deprecation of XDEBUG_CC_BRANCH_CHECK and the granular / separate flags shown above.

TagsNo tags attached.
Operating System
PHP Version8.5.0-8.5.4

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-04-29 09:43 sebastian New Issue