mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
bb8b95be63
If the expected return type of a magic method is "object", we also need to allow class types and "static" to comply with covariance.
22 lines
348 B
PHP
22 lines
348 B
PHP
--TEST--
|
|
__set_state return type should support covariance
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
public static function __set_state(array $data): self {}
|
|
}
|
|
|
|
class Foo2 {
|
|
public static function __set_state(array $data): static {}
|
|
}
|
|
|
|
class Foo3 {
|
|
public static function __set_state(array $data): Foo3|self {}
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|