summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt
blob: 52bd99beb6cd1f51d8686b8a906d3af8f99bc74f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
Test that the mixed return type is not compatible with a void return value
--FILE--
<?php

function foo(): mixed
{
}

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

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