1--TEST-- 2iterable type#003 - Return types 3--FILE-- 4<?php 5 6function foo(): iterable { 7 return []; 8} 9function bar(): iterable { 10 return (function () { yield; })(); 11} 12 13function baz(): iterable { 14 return 1; 15} 16 17var_dump(foo()); 18var_dump(bar()); 19 20try { 21 baz(); 22} catch (Throwable $e) { 23 echo $e->getMessage(); 24} 25 26?> 27--EXPECT-- 28array(0) { 29} 30object(Generator)#2 (0) { 31} 32baz(): Return value must be of type iterable, int returned 33