View Issue Details

IDProjectCategoryView StatusLast Update
0001211XdebugUncategorizedpublic2016-12-03 13:44
Reporternicolas-grekas Assigned To 
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