MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001466XdebugCode Coveragepublic2017-09-10 10:002017-09-24 20:41
ReporterCJ Dennis 
Assigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version2.5.5 
Target VersionFixed in Version 
Summary0001466: No code coverage for "elseif (is_string($value))" lines
DescriptionThe line `elseif (is_string($value)) {` never gets covered if the single keyword `elseif` is used with one of the `is_string()`, `is_integer()`, `is_bool()`, `is_array()`, etc. functions. Changing the keyword to the two keywords `else` and `if` produces the correct results.
Steps To ReproduceRun the following code:

<?php
$value = 'foo';
xdebug_start_code_coverage();
if (false) {
  echo 'What?';
}
elseif (is_string($value)) {
  echo 'OK!';
}
var_dump(xdebug_get_code_coverage());
?>

Expected results:
[
  4 => 1,
  7 => 1,
  8 => 1,
  10 => 1
]

Actual results:
[
  4 => 1,
  8 => 1,
  10 => 1
]

(line 7 is incorrectly missing)

If line 7 is changed to `else if (is_string($value)) {` (with a space between `else` and `if`) or `elseif ($value) {`, it is included in the coverage results.
TagsNo tags attached.
Operating SystemWindows 10
PHP Version7.1.5-7.1.9
Attached Files

- Relationships

-  Notes
(0004418)
derick (administrator)
2017-09-21 11:20

I can not reproduce this with Xdebug 2.5.5 and PHP 7.1.9:

derick@singlemalt:/tmp $ php /tmp/1466.php
OK!/tmp/1466.php:10:
array(1) {
  '/tmp/1466.php' =>
  array(4) {
    [4] =>
    int(1)
    [7] =>
    int(1)
    [8] =>
    int(1)
    [10] =>
    int(1)
  }
}

It shows the right output.

This is the same issue as 0001439, which got fixed in 2.5.5. Are you sure you're running the latest version and not for example 2.5.4?
(0004419)
CJ Dennis (reporter)
2017-09-21 12:15

I downloaded the latest Xdebug (2.5.5), but when I double-checked, I'd forgotten to update php.ini and it was still using 2.5.4!

So, you're correct, it's already fixed! Thank you!
(0004427)
derick (administrator)
2017-09-24 20:41

Was already fixed in 2.5.5.

- Issue History
Date Modified Username Field Change
2017-09-10 10:00 CJ Dennis New Issue
2017-09-21 11:20 derick Note Added: 0004418
2017-09-21 11:20 derick Assigned To => derick
2017-09-21 11:20 derick Status new => feedback
2017-09-21 12:15 CJ Dennis Note Added: 0004419
2017-09-21 12:15 CJ Dennis Status feedback => assigned
2017-09-24 20:41 derick Note Added: 0004427
2017-09-24 20:41 derick Status assigned => resolved
2017-09-24 20:41 derick Resolution open => no change required


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker