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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
7 + 10 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC