View Issue Details

IDProjectCategoryView StatusLast Update
0001280XdebugUncategorizedpublic2016-03-08 11:46
ReporterMazeChaZer Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
PlatformPHP 7OSLinux 
Product Version2.4.0rc4 
Fixed in Version2.4.0 
Summary0001280: Wrong coverage report in switch case statements since PHP 7
Description

Example code:

<?php

class SUT
{
public function foo($a)
{
switch ($a) {
case 'a':
case 'b': // <-- This line is reported not covered but it is
$b = 2;
break;
case 'c':
$b = 3;
break;
default:
$b = 4;
break;
}
return $b;
}
}

class Test extends PHPUnit_Framework_TestCase
{
public function test()
{
$sut = new SUT();
$this->assertEquals(2, $sut->foo('a'));
$this->assertEquals(2, $sut->foo('b'));
$this->assertEquals(3, $sut->foo('c'));
$this->assertEquals(4, $sut->foo('d'));
}
}

Steps To Reproduce

Run the example code with PHP 7 and PHPUnit 5.2.10

Additional Information

Works fine in PHP 5.6

TagsNo tags attached.
Operating SystemLinux
PHP Version7.0.0-7.0.4

Activities

derick

2016-03-04 15:40

administrator   ~0003545

Can you try Xdebug 2.4.0 which got released yesterday please?

And can you please provide full steps on how to run your use case? Just "run with phpunit" doesn't particularly help me :-)

MazeChaZer

2016-03-07 07:30

reporter   ~0003564

The issue is fixed in 2.4.0, thanks!

derick

2016-03-08 11:46

administrator   ~0003567

Thanks for the report, and checking whether it works with 2.4.0. Closing this out now.

Issue History

Date Modified Username Field Change
2016-03-03 14:47 MazeChaZer New Issue
2016-03-04 15:40 derick Note Added: 0003545
2016-03-04 15:40 derick Assigned To => derick
2016-03-04 15:40 derick Status new => feedback
2016-03-07 07:30 MazeChaZer Note Added: 0003564
2016-03-07 07:30 MazeChaZer Status feedback => assigned
2016-03-08 11:46 derick Note Added: 0003567
2016-03-08 11:46 derick Status assigned => resolved
2016-03-08 11:46 derick Fixed in Version => 2.4.0
2016-03-08 11:46 derick Resolution open => no change required
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