View Issue Details

IDProjectCategoryView StatusLast Update
0001413XdebugCode Coveragepublic2017-04-16 00:17
Reporterolvlvl Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMacOSMacOSOS Version10.12.03
Product Version2.5.1 
Fixed in Version2.5.2 
Summary0001413: Line is missing from code coverage
Description

I have two classes that are almost identical: Require and Require2. The first one inherits a constant from an interface, the second defines the constant. The line using the inherited constant appears as not covered, while the other one does:

public function normalize_params(array $params)
{
    return array_merge([

        self::OPTION_STOP_ON_ERROR => true

    ], $params);
}
Steps To Reproduce

Run the following command with the attached files:

phpunit --coverage-html build/coverage

Now check build/coverage/Required.php.html#16, the line appears as "Not executed", while build/coverage/Required2.php.html#16 is fine.

Additional Information

With OpCache disabled the line appears as "Not executed" in both classes.

PHP was installed with "brew".

TagsNo tags attached.
Attached Files
xdebug-bug-1.zip (11,566 bytes)
Operating SystemMacOS
PHP Version7.1.0-7.1.4

Activities

derick

2017-04-13 17:47

administrator   ~0004259

I tried reproducing this, but I can't. In both situations (opcache on, or off), both lines "16" in Required.php and Required2.php are marked as executable.

Can you please show the output of:

phpunit --version
php -v
php -m

cheers,
Derick

olvlvl

2017-04-13 23:46

reporter   ~0004260

Here:

PHPUnit 5.7.9 by Sebastian Bergmann and contributors.

PHP 7.1.3 (cli) (built: Mar 28 2017 21:57:28) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans

[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

derick

2017-04-15 14:48

administrator   ~0004263

OK. With PHP 7.1.3 I can reproduce this. With 7.1.4, I can not. It looks like PHP itself changed something. I am suspecting it is the fix for bug #69676 (https://bugs.php.net/bug.php?id=69676). This fix, seems to have caused some line numbers to go wrong. I can fix the symptom in Xdebug, but there is something more going wrong in PHP too I believe.

derick

2017-04-15 23:28

administrator   ~0004264

Fixed for 2.5.2.

And thanks for the excellent report!

olvlvl

2017-04-16 00:17

reporter   ~0004265

GTK there's already a fix. Thanks for your excellent work.

Issue History

Date Modified Username Field Change
2017-04-08 11:23 olvlvl New Issue
2017-04-08 11:23 olvlvl File Added: xdebug-bug-1.zip
2017-04-13 17:47 derick Note Added: 0004259
2017-04-13 17:47 derick Assigned To => derick
2017-04-13 17:47 derick Status new => feedback
2017-04-13 23:46 olvlvl Note Added: 0004260
2017-04-13 23:46 olvlvl Status feedback => assigned
2017-04-15 14:48 derick Note Added: 0004263
2017-04-15 23:28 derick Note Added: 0004264
2017-04-15 23:28 derick Status assigned => closed
2017-04-15 23:28 derick Resolution open => fixed
2017-04-15 23:28 derick Fixed in Version => 2.5.2
2017-04-16 00:17 olvlvl Note Added: 0004265