summaryrefslogtreecommitdiff
path: root/Zend/tests/object_types/return_type_in_function.phpt
blob: b94541c8d7cd49e3d1f123fd5097a1c2b742542b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--TEST--
Adding a function object return type
--FILE--
<?php

function a() : object {
    return 12345;
}
a();
--EXPECTF--
Fatal error: Uncaught TypeError: a(): Return value must be of type object, int returned in %s:%d
Stack trace:
#0 %s(6): a()
#1 {main}
  thrown in %s on line 4