--TEST-- Test typed properties yield reference guard --FILE-- foo; yield $this->bar; yield $this->baz; yield $this->qux; } }; try { foreach ($foo->fetch() as &$prop) { $prop += 1; } } catch (Error $e) { echo $e->getMessage(), "\n"; } var_dump($foo); ?> --EXPECTF-- Cannot assign float to reference held by property class@anonymous::$qux of type int object(class@anonymous)#1 (4) { ["foo"]=> int(2) ["bar"]=> int(4) ["baz"]=> int(6) ["qux"]=> &int(%d) }