mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
c5401854fc
This should fix most of the remaining issues with tabs and spaces being mixed in tests.
19 lines
545 B
PHP
19 lines
545 B
PHP
--TEST--
|
|
Magic Methods inheritance rules on a non-trivial class hierarchy
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
public function __get(string|array $name): mixed {} // valid
|
|
}
|
|
|
|
class B extends A {
|
|
public function __get(string|array|object $name): int {} // also valid
|
|
}
|
|
|
|
class C extends B {
|
|
public function __get(string|array|object $name): int|float {} // this is invalid
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of C::__get(object|array|string $name): int|float must be compatible with B::__get(object|array|string $name): int in %s on line %d
|