summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/rfc001.phpt
blob: 6a17525b724b0c37e71f1b26fd504306f1d46e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--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