View Issue Details

IDProjectCategoryView StatusLast Update
0001473XdebugCode Coveragepublic2017-09-20 20:41
Reporterexussum Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSUbuntuOS Version17.04
Product Version2.5.5 
Summary0001473: Coverage incorrect for $this
Description

Originally reported here
https://twitter.com/bretterer/status/910265995088089088

Steps To Reproduce

<?php
class a
{
function b()
{
return $this->c(
'a',
$this,
self::class
);
}

function c()
{

}

}

xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

$a = new a();
$a->b();

$cc = xdebug_get_code_coverage();
ksort($cc);
var_dump(array_slice($cc, 0, 1));
xdebug_stop_code_coverage(false);

Additional Information

array(1) {
'/tmp/test.php' =>
array(9) {
[6] =>
int(1)
[7] =>
int(1)
[8] =>
int(-1)
[9] =>
int(1)
[11] =>
int(-2)
[16] =>
int(1)
[21] =>
int(1)
[22] =>
int(1)
[24] =>
int(1)
}
}

Line 8 in this case should be 1 not -1

TagsNo tags attached.
Operating System
PHP Version7.0.20-7.0.24

Activities

exussum

2017-09-20 20:07

reporter   ~0004410

Hmm odd.

The bug appears to be fixed between the 2.5.5 release and the 2.5.4 release (using the tags on git)

git checkout XDEBUG_2_5_4 && make clean && make # Shows the bug
git checkout XDEBUG_2_5_5 && make clean && make # Fixes the bug

https://travis-ci.org/okta/okta-sdk-php/jobs/277787327

indicates 2.5.5 is used on the build, not sure how that is possible to show the wrong version there though ?

exussum

2017-09-20 20:19

reporter   ~0004411

Can likely be closed, 2.5.5 (and master by extension) have this fixed

derick

2017-09-20 20:41

administrator   ~0004412

Was already fixed in 2.5.5.

Issue History

Date Modified Username Field Change
2017-09-20 19:57 exussum New Issue
2017-09-20 20:07 exussum Note Added: 0004410
2017-09-20 20:19 exussum Note Added: 0004411
2017-09-20 20:41 derick Note Added: 0004412
2017-09-20 20:41 derick Status new => resolved
2017-09-20 20:41 derick Resolution open => no change required
2017-09-20 20:41 derick Assigned To => derick