View Issue Details

IDProjectCategoryView StatusLast Update
0000431XdebugUsage problems (Wrong Results)public2009-03-28 20:53
Reportermoto_kateAssigned Toderick 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionnot fixable 
Product Version 
Target VersionFixed in Version 
Summary0000431: In 2.0.4 version line that is executable, accessible, but not executed is not reported
DescriptionThe following code:

1 <?php
2 xdebug_start_code_coverage(XDEBUG_CC_UNUSED|XDEBUG_CC_DEAD_CODE);
3 function a() {
4 return NULL;
5 $c = 1;
6 }
7 $z = 5;
8 if($z == 5) {
9 $c = 3;
10 } else {
11 $c = 5;
12 }
13 a();
14 $cc = xdebug_get_code_coverage();
15 xdebug_stop_code_coverage();
16 var_dump($cc);
17 ?>

prints out:

["/home/data/Documents/php/Saga/Saga/trunk/MyTests/test1.php"]=>
  array(10) {
    [3]=>
    int(1)
    [4]=>
    int(1)
    [5]=>
    int(-2)
    [6]=>
    int(-2)
    [7]=>
    int(1)
    [8]=>
    int(1)
    [9]=>
    int(1)
    [10]=>
    int(1)
    [13]=>
    int(1)
    [14]=>
    int(1)
  }
}

Line 11 is ignored, while it should be included with -1 result.
Additional Informationphp -v:

PHP 5.2.6-2ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:44:58)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans
TagsNo tags attached.
Operating SystemUbuntu 8.10
PHP Version5.2.6

Activities

derick

2009-03-28 20:53

administrator   ~0000947

This can not (easily) be fixed. Executable lines are only counted for every file included or required after "xdebug_start_code_coverage(XDEBUG_CC_UNUSED" is used.

Issue History

Date Modified Username Field Change
2009-02-25 12:02 moto_kate New Issue
2009-02-25 12:02 moto_kate Operating System => Ubuntu 8.10
2009-02-25 12:02 moto_kate PHP Version => 5.2.6
2009-02-25 12:02 moto_kate Xdebug Version => 2.0.4-dev
2009-03-28 20:53 derick Note Added: 0000947
2009-03-28 20:53 derick Status new => resolved
2009-03-28 20:53 derick Resolution open => not fixable
2009-03-28 20:53 derick Assigned To => derick
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)