php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75422 Incorrect code coverage report
Submitted: 2017-10-24 03:47 UTC Modified: -
Votes:5
Avg. Score:3.8 ± 1.2
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: morozov at tut dot by Assigned:
Status: Open Package: phpdbg
PHP Version: 7.1.10 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-10-24 03:47 UTC] morozov at tut dot by
Description:
------------
During code coverage using PHPDBG, some lines of code are executed but are not reported covered.

Test script:
---------------
↪  phpdbg -qrr coverage.php 

<?php

phpdbg_start_oplog();

$a = [
    'foo' => 0,
    'bar' => true,
];

switch (true) {
    case false:
        echo 'here';
        break;
}

var_dump(phpdbg_get_executable());

Expected result:
----------------
array(1) {
  '/home/morozov/coverage.php' =>
  array(6) {
    [3] =>
    int(0)
    [6] =>
    int(0)
    [7] =>
    int(0)
    [10] =>
    int(0)
    [11] =>
    int(0)
    [12] =>
    int(0)
    [13] =>
    int(0)
    [16] =>
    int(0)
  }
}


Actual result:
--------------
array(1) {
  '/home/morozov/coverage.php' =>
  array(6) {
    [3] =>
    int(0)
    [6] =>
    int(0)
    [11] =>
    int(0)
    [12] =>
    int(0)
    [13] =>
    int(0)
    [16] =>
    int(0)
  }
}

Lines 7 and 10 are not reported as covered.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 14:01:28 2019 UTC