View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001448XdebugCode Coveragepublic2017-06-08 16:592017-07-22 09:28
Assigned Toderick 
StatusresolvedResolutionno 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
Attached Files? file icon test.php [^] (664 bytes) 2017-06-08 16:59

- Relationships

-  Notes
derick (administrator)
2017-07-22 09:28

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 16:59 nickel715 New Issue
2017-06-08 16:59 nickel715 File Added: test.php
2017-07-22 09:28 derick Note Added: 0004380
2017-07-22 09:28 derick Status new => resolved
2017-07-22 09:28 derick Resolution open => no change required
2017-07-22 09:28 derick Assigned To => derick

Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker