mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
912cb8b8b5
Iterable was not considered a subtype of array|object, and thus also not a subtype of mixed.
24 lines
479 B
PHP
24 lines
479 B
PHP
--TEST--
|
|
Iterable not covariant to mixed
|
|
--FILE--
|
|
<?php
|
|
|
|
class A {
|
|
public function method1(): mixed {}
|
|
public function method2(): array|object {}
|
|
public function method3(iterable $x) {}
|
|
public function method4(iterable $x) {}
|
|
}
|
|
|
|
class B extends A {
|
|
public function method1(): iterable {}
|
|
public function method2(): iterable {}
|
|
public function method3(mixed $x) {}
|
|
public function method4(array|object $x) {}
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|