ZF2-14: ReflectionFile confuses "as" of foreach and "as" of namespace


When you try to open reflection of file like that:

$file = new \Zend\Reflection\ReflectionFile($fileName);

And if any method of class placed in this file use foreach function, returns notice: Notice: Undefined offset: 0 in /library/Zend/library/Zend/Reflection/ReflectionFile.php on line 373

I think except notice we have wrong behavior.


Was unable to reproduce in the tests, could you provide a simple example.

I was using:

public function doSomething()
    $a = array(1,2,3);

    foreach ($a as $key => $value) {

I tested this thing with fresh version from master branch, and no problems with it now. Sorry, I think issue to close.

Can't reproduce on dev3 snapshot.