Iterable type hint breaks newinstance()
thekid opened this issue · 1 comments
thekid commented
abstract class Base {
public abstract function fixture(iterable $arg);
}
newinstance(Base::class, [], [
'fixture' => function(iterable $arg) { }
]);
Uncaught error: Compile error (Declaration of Base▒1::fixture($args) must be compatible with Base::fixture(iterable $args))
Since PHP 7.1 - see https://wiki.php.net/rfc/iterable
thekid commented
Same goes for object
introduced in PHP 7.2 - https://wiki.php.net/rfc/object-typehint