View Issue Details

IDProjectCategoryView StatusLast Update
0001788XdebugCode Coveragepublic2020-05-28 13:03
ReporterdvdougAssigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionduplicate 
Product Version2.9.5 
Target VersionFixed in Version 
Summary0001788: Branch coverage data does not always get returned in the lines/functions format (w/Opcache)
DescriptionSee steps to reproduce. With opcache.enable_cli=1, the data for 3.php is returned as lines only. Commenting out the call to require '2.php' makes the data come back as lines/functions as expected.

With opcache turned off, the data for 3.php is always returned as lines/functions as expected.
Steps To Reproduce1.php
<?php
require '2.php';
require '3.php';

xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);

$bar = 'bar';

$class = new Baz();
$class->baz();

print_r(xdebug_get_code_coverage());


2.php
<?php

$foo = 'bar';

3.php
<?php

class Baz
{

    public function baz()
    {
        $foo = 'baz';
    }

}
Additional Informationhttps://bugs.xdebug.org/view.php?id=1787 is similar but the way of triggering it is different so I'm reporting this as a seperate bug in case fixing one does not automatically fix the other.
TagsNo tags attached.
Operating System
PHP Version7.4.0-7.4.4

Relationships

duplicate of 0001787 closedderick Branch coverage data does not always follow the lines/functions format 

Activities

derick

2020-05-28 13:03

administrator   ~0005419

Hi again,

this turned out to be the same problem as 0001787, so no code changes were necessary.

cheers,
Derick

Issue History

Date Modified Username Field Change
2020-05-24 15:33 dvdoug New Issue
2020-05-28 13:03 derick Assigned To => derick
2020-05-28 13:03 derick Status new => resolved
2020-05-28 13:03 derick Resolution open => duplicate
2020-05-28 13:03 derick Note Added: 0005419
2020-05-28 13:03 derick Relationship added duplicate of 0001787