View Issue Details

IDProjectCategoryView StatusLast Update
0001211XdebugUncategorizedpublic2016-12-03 13:44
Reporternicolas-grekas Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Summary0001211: ReflectionGenerator reports wrong line number with xdebug
Description

PHP7 without xdebug reports a different executing line than with it.

Steps To Reproduce

<?php

class GeneratorDemo
{
public static function foo()
{
yield 1;
}

public function baz()
{
    yield from bar();
}

}

function bar()
{
yield from GeneratorDemo::foo();
}

$g = new GeneratorDemo();
$g = $g->baz();
$r = new \ReflectionGenerator($g);

echo $r->getExecutingLine();

TagsNo tags attached.
Operating System
PHP Version7.0-dev

Activities

derick

2015-11-24 12:51

administrator   ~0003260

I can indeed reproduce this, but fixing it is going to be non-trivial. As it doesn't segfault, and it "only" causes an issue with reflection, I'm unlikely to put this at the top of the priority list.

derick

2016-12-03 13:44

administrator   ~0003887

Hi,

I had another look at this, and this is not something that is caused by Xdebug directly, but instead by how PHP generates opcodes in different modes.

I can reproduce this, by not loading any extension, and enabling or disabling "Generate extended information for debugger/profiler":

[PHP: 7.0.13-dev ] derick@whisky:/tmp $ php -n 1211.php
12

[PHP: 7.0.13-dev ] derick@whisky:/tmp $ php -n -e 1211.php
10

As this is something internal to PHP, and Xdebug needs this "extended information" (it turns it on internally through an API), I can not fix this on the Xdebug side.

cheers,
Derick

Issue History

Date Modified Username Field Change
2015-11-24 08:57 nicolas-grekas New Issue
2015-11-24 12:51 derick Note Added: 0003260
2015-11-24 12:51 derick Assigned To => derick
2015-11-24 12:51 derick Status new => acknowledged
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-12-03 13:44 derick Note Added: 0003887
2016-12-03 13:44 derick Status acknowledged => resolved
2016-12-03 13:44 derick Resolution open => not fixable
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized