View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001479 | Xdebug | Code Coverage | public | 2017-10-10 21:18 | 2017-11-01 22:54 |
Reporter | morozov | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Summary | 0001479: The line containing a boolean value of an array element is not considered covered | ||||
Description | Using the same Xdebug version (2.5.5) but depending on the PHP version (5.6 or 7.1), the same line of code is or is not reported as covered. It looks like it depends on the value type (only the boolean value has this issue while the integer one doesn't). | ||||
Steps To Reproduce | Consider the following PHP script: <?php $array = array( var_dump(xdebug_get_code_coverage()); $ php -v $ php coverage.php $ php -v $ php coverage.php | ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 7.1.0-7.1.4 | ||||
|
This is an improvement in PHP 7.1 - it has the array initialisation optimised from using 3 opcodes in PHP 5.6: line #* E I O op fetch ext return operands5 5 INIT_ARRAY 0000002:0000001 1, 'int' To just one in PHP 7.1: line #* E I O op fetch ext return operands5 6 ASSIGN !0, <array> Xdebug correctly shows there is no executable code at all on lines 6 and 7 with PHP 7.1 (use the XDEBUG_CC_UNUSED and XDEBUG_CC_DEAD_CODE options to xdebug_start_code_coverage), which means there is nothing to fix here. |
|
Thank you for the explanation. Do I understand correctly that the resulting opcode references only one of the lines of the source code it was built from? So when the bytecode executed with code coverage enabled, the information about the source lines is unavailable. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-10-10 21:18 | morozov | New Issue | |
2017-11-01 21:46 | derick | Note Added: 0004450 | |
2017-11-01 21:46 | derick | Status | new => resolved |
2017-11-01 21:46 | derick | Resolution | open => no change required |
2017-11-01 21:46 | derick | Assigned To | => derick |
2017-11-01 22:54 | morozov | Note Added: 0004451 |