xref: /php-src/Zend/tests/return_types/043.phpt (revision e3d06fc7)
1--TEST--
2Some magic methods can declare mixed return type
3--FILE--
4<?php
5class Foo {
6    public function __get($name): bool {}
7    public function __call($name, $args): string {}
8    public static function __callStatic($name, $args): self {}
9    public function __invoke(): self {}
10}
11
12class Bar {
13    public function __get($name): string|array {}
14    public function __call($name, $args): int|float {}
15    public static function __callStatic($name, $args): ?object {}
16    public function __invoke(): Foo|int {}
17}
18
19class Baz {
20    public function __get($name): mixed {}
21    public function __call($name, $args): mixed {}
22    public static function __callStatic($name, $args): mixed {}
23    public function __invoke(): mixed {}
24}
25
26echo 'Okay!';
27?>
28--EXPECT--
29Okay!
30