View Issue Details

IDProjectCategoryView StatusLast Update
0000323XdebugUncategorizedpublic2007-10-27 17:02
ReportertobyS Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Summary0000323: Code coverage indicated incorrectly
Description

As seen in the snip, all relevant lines are executed 154 times (correctly) and some are unreachable (logically), but the closing brace of the ternary is not recognized to be either and marked as not executed.

PHP version is actually 5.2.4.

Additional Information

From a code coverage report of PHPUnit:

<snip>
154 : foreach ( $response->responses as $subResponse )
: {
154 : $multistatusElement->appendChild(
: ( $subResponse instanceof ezcWebdavErrorResponse
154 : ? $dom->importNode( $this->processErrorResponse( $subResponse, true )->body->documentElement, true )
154 : : $dom->importNode( $this->processResponse( $subResponse )->body->documentElement, true )
0 : )
154 : );
154 : }
</snip>

TagsNo tags attached.
Operating SystemGentoo (but manually compiled PHP stuff)
PHP Version5.2-dev

Activities

derick

2007-10-27 17:02

administrator   ~0000765

There is not much that I can do about it, the line numbers that the engine reports here totally make no sense. I simplified the code to:

1 <?php
2 function doSomething( $foo ) { echo $foo, "\n"; }
3
4 doSomething (
5 ( false
6 ? 42
7 : 43
8 )
9 );
10 ?>

The generated opcodes are:

line # op fetch ext return operands

2 0 EXT_STMT
1 NOP
4 2 EXT_STMT
3 EXT_FCALL_BEGIN
6 4 JMPZ false, ->7
7 5 QM_ASSIGN ~0 42
6 JMP ->8
8 7 QM_ASSIGN ~0 43
9 8 SEND_VAL ~0
9 DO_FCALL 1 'dosomething'
10 EXT_FCALL_END
11 11 EXT_STMT
12 RETURN 1
13* ZEND_HANDLE_EXCEPTION

As you can see, the assignments (op 5 and 7) are done on the line after the actual "assignment" (7 and 8 instead of 6 and 7).

Issue History

Date Modified Username Field Change
2007-10-23 19:51 tobyS New Issue
2007-10-27 17:02 derick Status new => resolved
2007-10-27 17:02 derick Resolution open => not fixable
2007-10-27 17:02 derick Assigned To => derick
2007-10-27 17:02 derick Note Added: 0000765
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