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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: morozov at tut dot by
New email:
PHP Version: OS:

 

 [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

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 27 16:01:27 2024 UTC