View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001540 | Xdebug | Code Coverage | public | 2018-03-26 14:31 | 2019-08-26 12:37 |
| Reporter | theoboldt | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Linux | OS | Ubuntu | OS Version | 16.04.1 |
| Product Version | 2.6.0 | ||||
| Target Version | 2.8.0dev | Fixed in Version | 2.8.0beta2 | ||
| Summary | 0001540: Multiline class instantiate within method call is not covered when using php-fpm | ||||
| Description | When instantiating a class within a method call and the variables for the new object are passed in separate lines, the lines containing the parameters are not marked as covered when php is executed by FPM. The lines are marked as covered as expected when the same file is executed via CLI using same php/xdebug version.
When executing above code via CLI, following output is generated:
When executing above code via Apache 2 (Server API: FPM/FastCGI, PHP API: 20151012, PHP Extension: 20151012) the output differs significantly for line 12, 13, 14, 15:
| ||||
| Steps To Reproduce | Execute provided snipped via php-fpm and via cli as well, compare results | ||||
| Tags | PHP7 | ||||
| Operating System | ubuntu0.16.04.1 | ||||
| PHP Version | 7.0.25-7.0.29 | ||||
|
|
Still reproducible using xdebug 2.6.1. |
|
|
Reproducible also having opcache disabled: |
|
|
Also reproducible using php 7.2: opcache enabled: {code} opcache disabled: {code} |
|
|
I'm going to have to try this, but I'm pretty certain it's a similar issue as what I explained in this blog article: https://derickrethans.nl/breakpoints.html |
|
|
Good to hear that there might be a solution some day! Just besides - I've no idea why the uploads except "multiline_class_instantiate.php" were added - I don't assume that any document or archive is helpful here. It's much likelier that they do have hazardous contents. |
|
|
I've tried reproducing this, but I'm not having any luck. Would you mind adding phpinfo() output for both the CLI and PHP-FPM variants with the same PHP version (like in your original report). With as only change using -dhtml_errors=1 to the CLI variant, so that its phpinfo() output is also in HTML? (That makes it easier to diff them for me). |
|
|
I added the phpinfo() outputs as files. Unfortunately, although I was successfully able to enable I also executed the phpinfo script with the built in HTTP server, which also uses the cli php configuration (possibly with some variations you might be more aware of). This environment is also not affected by the issue (as the cli isn't as well): {code}
|
|
|
I'm going to have a look at this after Xdebug 2.7.0 has been released. Thanks for the feedback so far! |
|
|
I reckon that just like with 0001541, you have xdebug.code_coverage=0 for this one as well? |
|
|
Exactly - I verified, if executed using xdebug.code_coverage=1, the issue is not occurring: |
|
|
Fixed in 2.8.0beta2, by making sure there is a warning when you want to use code coverage when xdebug.code_coverage=0 |