MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001473XdebugCode Coveragepublic2017-09-20 20:572017-09-20 21:41
Reporterexussum 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformLinuxOSUbuntuOS Version17.04
Product Version2.5.5 
Target VersionFixed in Version 
Summary0001473: Coverage incorrect for $this
DescriptionOriginally 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 Informationarray(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
Attached Files

- Relationships

-  Notes
(0004410)
exussum (reporter)
2017-09-20 21:07

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 ?
(0004411)
exussum (reporter)
2017-09-20 21:19

Can likely be closed, 2.5.5 (and master by extension) have this fixed
(0004412)
derick (administrator)
2017-09-20 21:41

Was already fixed in 2.5.5.

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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker