1--TEST-- 2Fully qualified classes in trait return types 3--FILE-- 4<?php 5 6namespace FooSpace; 7 8trait Fooable { 9 function foo(): \Iterator { 10 return new \EmptyIterator(); 11 } 12} 13 14class Foo { 15 use Fooable; 16} 17 18$foo = new Foo; 19var_dump($foo->foo([])); 20?> 21--EXPECTF-- 22object(EmptyIterator)#%d (%d) { 23} 24