1--TEST-- 2Magic Methods inheritance rules on a non-trivial class hierarchy 3--FILE-- 4<?php 5class A { 6 public function __get(string|array $name): mixed {} // valid 7} 8 9class B extends A { 10 public function __get(string|array|object $name): int {} // also valid 11} 12 13class C extends B { 14 public function __get(string|array $name): int {} // this is invalid 15} 16?> 17--EXPECTF-- 18Fatal error: Declaration of C::__get(array|string $name): int must be compatible with B::__get(object|array|string $name): int in %s on line %d 19