blob: 3e923983d7d26a6cb05989336fcd6695d903176a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
--TEST--
Adding a function object type hint
--FILE--
<?php
class A {}
function a(object $obj) {}
a(new A());
a(123);
--EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an object, int given, called in %s.php on line 7 and defined in %s:4
Stack trace:
#0 %s(7): a(123)
#1 {main}
thrown in %s on line 4
|