Issues

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

Issue Type: Bug Created: 2011-05-30T15:38:56.000+0000 Last Updated: 2011-07-07T07:18:00.000+0000 Status: Closed Fix version(s): Reporter: Evgheni Poleacov (zendmania) Assignee: Ralph Schindler (ralph) Tags: - Zend\Reflection

  • reflection

Related issues: Attachments:

Description

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.

Comments

Posted by Keith Pope (mute) on 2011-07-03T07:22:35.000+0000

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

I was using:

<pre class="highlight">
public function doSomething()
{
    $a = array(1,2,3);

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

Posted by Evgheni Poleacov (zendmania) on 2011-07-07T07:10:43.000+0000

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

Posted by Evgheni Poleacov (zendmania) on 2011-07-07T07:18:00.000+0000

Can't reproduce on dev3 snapshot.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts