View Issue Details

IDProjectCategoryView StatusLast Update
0001799XdebugCode Coveragepublic2020-06-19 15:13
ReporterdvdougAssigned Toderick 
PrioritynormalSeveritymajorReproducibilitysometimes
Status acknowledgedResolutionopen 
Product Version2.9.6 
Target VersionFixed in Version 
Summary0001799: Inconsistent output of branch/path data when running under Opcache
DescriptionWhen running under Opcache, the first run returns a full set of data. Subsequent runs do not.

Specifically in the attached testcase, there are 2 entries in the function data on the first call "SomeClass->getItems" and "{main}". In the second/third/etc invocations the only entry is for "{main}"
Steps To ReproduceWith opcache.enable=1, opcache.enable_cli=1

SomeClass.php
<?php


class SomeClass
{
    public function getItems()
    {
        return 'foo';
    }

}


Test script (please run twice)
<?php
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);
require_once 'SomeClass.php';
$class = new SomeClass();

print_r(xdebug_get_code_coverage());
Additional InformationThis minimal testcase does not include a call to the method, but this reproduces for me even if you do
TagsNo tags attached.
Operating SystemWindows 10
PHP Version7.4.0-7.4.4

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-06-15 16:19 dvdoug New Issue
2020-06-19 15:13 derick Assigned To => derick
2020-06-19 15:13 derick Status new => acknowledged