php-src/Zend/tests/magic_methods_inheritance_rules_non_trivial_01.phpt
Nikita Popov c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00

19 lines
519 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 $name): int {} // this is invalid
}
?>
--EXPECTF--
Fatal 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