summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/rfc001.phpt
blob: 5a1d42b446961ae927505b4948fe0228f18de7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
RFC example: returned type does not match the type declaration

--FILE--
<?php

function get_config(): array {
    return 42;
}

get_config();

--EXPECTF--
Fatal error: Uncaught TypeError: Return value of get_config() must be of the type array, integer returned in %s:%d
Stack trace:
#0 %s(%d): get_config()
#1 {main}
  thrown in %s on line %d