/**
  * @group foreach
  */
 public function testForeach3()
 {
     $this->registry->registerClass($foo = new Clazz('Foo'));
     $foo->setTypeRegistry($this->registry);
     $foo->addImplementedInterface('Iterator');
     $foo->addMethod($current = new Method('current'));
     $current->setReturnType($this->registry->getClassOrCreate('Bar'));
     $this->assuming('y', 'object<Foo>');
     $this->inMethod('$x = $i = null; foreach ($y as $i => $x);');
     $this->verify('x', $this->createNullableType('object<Bar>'));
     $this->verify('i', $this->createNullableType('integer|string'));
 }