View Issue Details

IDProjectCategoryView StatusLast Update
0001448XdebugCode Coveragepublic2017-07-22 08:28
Reporternickel715Assigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSDebianOS Version8
Product Version2.5.1 
Target VersionFixed in Version 
Summary0001448: Line covered even though not all
DescriptionI'm not sure if xdebug code coverage is intended to detect this, but I like to write php code like this:
!empty($var) && doSomething($var);

unfortunately this line is covered event though doSomething gets not executed.

Steps To ReproduceI provide some example code to reproduce it
TagsNo tags attached.
Operating SystemLinux
PHP Version7.1.5-7.1.9

Activities

nickel715

2017-06-08 15:59

reporter  

test.php (664 bytes)

derick

2017-07-22 08:28

administrator   ~0004380

Although "doSomething" doesn't get executed, the !empty is executed. Xdebug can't really tell the difference as PHP just provides line numbers - and some of this line is executed.

So this is how it correctly works.

Issue History

Date Modified Username Field Change
2017-06-08 15:59 nickel715 New Issue
2017-06-08 15:59 nickel715 File Added: test.php
2017-07-22 08:28 derick Note Added: 0004380
2017-07-22 08:28 derick Status new => resolved
2017-07-22 08:28 derick Resolution open => no change required
2017-07-22 08:28 derick Assigned To => derick