[xdebug-dev] Bug 0000237: xdebug_get_code_coverage() getting incorrect results

From: <noreply[@]lists.xdebug.org>
Date: Mon, 22 Jan 2007 20:06:12 +0100

The following bug has been RESOLVED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000237
======================================================================
Reporter: proofek
Handler: derick
======================================================================
Project: Xdebug
Bug ID: 237
Category: Usage problems
Reproducibility: always
Severity: tweak
Priority: normal
Status: resolved
Operating System: Linux, Debian Dapper
PHP Version: 5.1.6
Xdebug Version: 2.0.0rc1
Resolution: not fixable
======================================================================
Date Submitted: 2007-01-22 17:26 CET
Last Modified: 2007-01-22 20:06 CET
======================================================================
Summary: xdebug_get_code_coverage() getting incorrect results
Description:
It looks like that data gathered with xdebug_get_code_coverage() function
are not quite correct.

When executing the code above it is saying that only 3 last lines has been
executed, while it is obvious (I think) that assigning to a variable should
be executed as well.

$strQuery = 'SELECT
                    field1,
                    field2,
                    field3,
                    field4,
                    field5,
                    field6,
                    field7,
                    field8,
                    field9,
                    field10,
                    field11
        FROM
                    table
        WHERE
            field1 = "'.$strTransactionCode.'"
            AND field2 = "'.$strReference.'"
            AND field3 = '.$intVersion;

======================================================================

----------------------------------------------------------------------
 derick - 2007-01-22 20:06 CET
----------------------------------------------------------------------
I checked this with VLD, and it seems the Zend Engine sees the assignment
happening on the last line of the whole statement. As the engine doesn't
expose the correct data, Xdebug can not return the correct information.
However, it is possible to ask Xdebug to also tell which lines are
executable. You need to do this then:
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

Bug History
Date Modified Username Field Change
======================================================================
2007-01-22 17:26proofek New Bug
2007-01-22 17:26proofek Bug Monitored: proofek
2007-01-22 20:06derick Bugnote Added: 0000556
2007-01-22 20:06derick Assigned To => derick
2007-01-22 20:06derick Resolution open => not fixable
2007-01-22 20:06derick Status new => resolved
======================================================================
Received on Mon Jan 22 2007 - 20:06:34 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST