1--TEST-- 2Return type allowed in child when parent does not have return type 3--FILE-- 4<?php 5class Comment {} 6 7class CommentsIterator extends ArrayIterator implements Iterator { 8 function current() : Comment { 9 return parent::current(); 10 } 11} 12 13$comments = new CommentsIterator([new Comment]); 14foreach ($comments as $comment) { 15 var_dump($comment); 16} 17--EXPECTF-- 18object(Comment)#%d (%d) { 19} 20