View Issue Details

IDProjectCategoryView StatusLast Update
0001740XdebugCode Coveragepublic2020-04-09 08:53
ReporteraxentAssigned Toderick 
PrioritynormalSeverityminorReproducibilityrandom
Status resolvedResolutionunable to reproduce 
PlatformmacOSAlpine LinuxOS Versionv3.11
Product Version2.9.1 
Target VersionFixed in Version 
Summary0001740: No marked as coverage by array_merge as function attribute
Descriptionalthough codeline was tested, covarege shows the line of code as untested
TagsNo tags attached.
Operating System
PHP Version7.4.0-7.4.4

Activities

axent

2020-01-28 06:15

reporter  

derick

2020-01-28 15:52

administrator   ~0005232

Please attach the whole file (and only the file), that shows this problem.

derick

2020-03-12 16:20

administrator   ~0005291

Can you please supply the requested information?

axent

2020-03-13 13:36

reporter   ~0005297

Sorry, It was refactored and I can not find more the part in source code. :(

derick

2020-03-24 10:41

administrator   ~0005338

Okay, that's fine. Let me know (in a new issue) when you see this happening again, and then please attach that whole file to the ticket.

lugus

2020-03-30 12:52

reporter   ~0005360

Hello, thanks for your great work.

Got this issue too FYI. Cannot drop client file here but here somme explanation for my case:

Working:

$bar = [
            'data' => [
                'select' => array_merge(
                    $queryTableDataSelect,
                    [
                        'foo',
                        'bar',
                    ]
                )
            ]
        ];

Not working:

$foo = [
            'data' => [
                'parent_select' => [
                    'select' => []
                ],
                'select' => array_merge(
                    $queryTableDataSelect,
                    [
                        'foo',
                        'bar',
                    ]
                )
            ]
        ];

Cannot join file, got error from database.

lugus

2020-03-30 12:55

reporter   ~0005361

Forgot version when i re-write issue: PHP 7.4.4 and xDebug 2.9.2

michieldilissen

2020-04-09 08:39

reporter   ~0005379

I am having the same issue. I have found this to be the case with multiple php functions such as json_encode, array_merge, array_map, sprintf, ...
In my instance these functions are not covered when placing them in multi-line, but are covered when placing the code inline.

Working:
$foo = [
    'bar' => json_encode(['Hello' => 'World'], JSON_THROW_ON_ERROR, 512)
];

Not working:
$foo = [
    'bar' => json_encode(
        ['Hello' => 'World'],
        JSON_THROW_ON_ERROR,
        512
    )
];

in this not working example the line 'bar' => json_encode( is marked as not covered.

derick

2020-04-09 08:53

administrator   ~0005380

Please create a new bug report (this is closed) when providing whole files that I can "php -r" , and tell me which exact lines aren't covered. Please read the instructions on what I need at https://xdebug.org/reporting-bugs (I'll add a specific code coverage section in a few hours).

Issue History

Date Modified Username Field Change
2020-01-28 06:15 axent New Issue
2020-01-28 06:15 axent File Added: Bildschirmfoto 2020-01-28 um 07.12.04.png
2020-01-28 15:52 derick Assigned To => derick
2020-01-28 15:52 derick Status new => feedback
2020-01-28 15:52 derick Note Added: 0005232
2020-03-12 16:20 derick Note Added: 0005291
2020-03-13 13:36 axent Note Added: 0005297
2020-03-13 13:36 axent Status feedback => assigned
2020-03-24 10:41 derick Status assigned => resolved
2020-03-24 10:41 derick Resolution open => unable to reproduce
2020-03-24 10:41 derick Note Added: 0005338
2020-03-30 12:52 lugus Note Added: 0005360
2020-03-30 12:55 lugus Note Added: 0005361
2020-04-09 08:39 michieldilissen Note Added: 0005379
2020-04-09 08:53 derick Note Added: 0005380