View Issue Details

IDProjectCategoryView StatusLast Update
0000238XdebugUsage problems (Wrong Results)public2007-02-09 21:19
ReporterArjenAssigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionnot fixable 
Product Version 
Target VersionFixed in Version 
Summary0000238: Incorrect code coverage
Description<?php

xdebug_start_code_coverage();

try {
    if(time() < 0)
        throw new Exception('lalala');
}
catch(Exception $e)
{
    echo "exception catched";
}

try {
    if(time() < 0)
    {
        throw new Exception('lalala');
    }
}
catch(Exception $e)
{
    echo "exception catched";
}

var_dump(xdebug_get_code_coverage());



array
  '/data/home/arjen/public_html/codecoverage.php' =>
    array
      6 => int 1
      7 => int 1
      9 => int 1
      15 => int 1
      16 => int 1
      20 => int 1
      25 => int 1

When short-style if-statements are used, the line 'throw new Exception(..) is marked as executed. When curly brackets are used, the line is NOT marked as executed. This is the expected behavior, as the exception is not thrown.
TagsNo tags attached.
Operating System
PHP Version5.2.0

Activities

derick

2007-02-09 21:19

administrator   ~0000563

Unfortunately I can not fix this, as the Zend engine simply doesn't provide the correct line information for every opcode it uses.

Issue History

Date Modified Username Field Change
2007-02-07 15:01 Arjen New Issue
2007-02-09 21:19 derick Status new => resolved
2007-02-09 21:19 derick Resolution open => not fixable
2007-02-09 21:19 derick Assigned To => derick
2007-02-09 21:19 derick Note Added: 0000563
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)