View Issue Details

IDProjectCategoryView StatusLast Update
0000472XdebugUncategorizedpublic2009-10-15 17:25
Reporterauroraeosrose Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.0.0dev 
Summary0000472: Dead Code Analysis for code coverage messed up after goto
Description

in 5.3 the following code

if ($foo) {
goto blah;
}

The bottom closing brace always shows up as an "uncovered" line of code

TagsNo tags attached.
Operating SystemN/A
PHP Version5.3.0

Activities

derick

2009-10-09 13:28

administrator   ~0001083

I can not reproduce this with Xdebug from CVS/HEAD:

derick@kossu:~/dev/php/xdebug/tests$ cat bug00472test.php
<?php require 'bug00472.phpt';
class CcTest extends PHPUnit_Framework_TestCase
{
public function testOne()
{
GotoTest::testMethod();
}
}
?>

derick@kossu:~/dev/php/xdebug/tests$ cat bug00472.phpt
<?php
class GotoTest
{
static public function testMethod()
{
$foo = true;

    if ($foo) {
        goto blah;
    }
    echo 42, "\n";

    blah:
        echo 42, "\n";
}

}
?>

derick@kossu:~/dev/php/xdebug/tests$ phpunit --coverage-html /tmp/report bug00472test.php

Marks line 10 as grey, and line 11 as red.

auroraeosrose

2009-10-09 14:44

reporter   ~0001084

put another if anotherneath it

class GotoTest
{
static public function testMethod()
{
$foo = true;
$bar = false;

    if ($foo) {
        goto blah;
    }
    if ($bar) {
        goto blah;
    }

    blah:
        echo 42, "\n";
}

}

derick

2009-10-10 10:32

administrator   ~0001088

That creates: http://files.derickrethans.nl/bug472.png which is what I would expect. Do you get something else?

derick

2009-10-15 17:25

administrator   ~0001093

Fixed in CVS (HEAD only)

Issue History

Date Modified Username Field Change
2009-09-19 00:14 auroraeosrose New Issue
2009-09-19 00:14 auroraeosrose Operating System => N/A
2009-09-19 00:14 auroraeosrose PHP Version => 5.3.0
2009-09-19 00:14 auroraeosrose Xdebug Version => 2.0.5
2009-10-09 13:28 derick Note Added: 0001083
2009-10-09 13:28 derick Status new => feedback
2009-10-09 14:44 auroraeosrose Note Added: 0001084
2009-10-10 10:32 derick Note Added: 0001088
2009-10-15 17:25 derick Note Added: 0001093
2009-10-15 17:25 derick Status feedback => closed
2009-10-15 17:25 derick Resolution open => fixed
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized