summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt
blob: ded74b046791f58c0fe4027a92f7d5f3fa6208ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
Test that the mixed return type is not compatible with a void return value in strict mode
--FILE--
<?php
declare(strict_types=1);

function foo(): mixed
{
}

try {
    foo();
} catch (TypeError $exception) {
    echo $exception->getMessage() . "\n";
}

?>
--EXPECTF--
Return value of foo() must be of type mixed, none returned