View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001754 | Xdebug | Code Coverage | public | 2020-03-05 09:29 | 2022-11-05 09:51 |
Reporter | juancasanova | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | not fixable | ||
Product Version | 2.9.2 | ||||
Summary | 0001754: Incorrect code coverage in nested ifs | ||||
Description | I have made a simple script like this: <pre>
When using Xdebug's code coverage calculation, it shows that both lines 3 and 5 are beign executed although it is obviously impossible. I have actually tested this with PHP 7.1.33, 7.2.28, 7.3.15 and 7.4.3 (all with Xdebug 2.9.2). | ||||
Steps To Reproduce | I have attached a small script that replicates the failure every time. | ||||
Tags | No tags attached. | ||||
Operating System | Ubuntu 18.0.4 | ||||
PHP Version | 7.4.0-7.4.4 | ||||
|
|
|
I've analysed your test file with vld, and that gives me the following output: <pre>
|
|
the solution is to enable opcache for CLI (opcache.enable_cli=1), then the l5 and l8 are correctly pruned/excluded |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-03-05 09:29 | juancasanova | New Issue | |
2020-03-05 09:29 | juancasanova | File Added: test.php | |
2020-03-05 13:09 | derick | Description Updated | |
2020-03-06 12:06 | derick | Assigned To | => derick |
2020-03-06 12:06 | derick | Status | new => resolved |
2020-03-06 12:06 | derick | Resolution | open => not fixable |
2020-03-06 12:06 | derick | Note Added: 0005275 | |
2022-11-05 09:51 | videoice | Note Added: 0006437 |