summaryrefslogtreecommitdiff
path: root/tests/lang/type_hints_001.phpt
blob: eb17ff5b8d399e3c5ec6339487c8564ec904eb40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
ZE2 type hinting
--FILE--
<?php

class Foo {
}

class Bar {
}

function type_hint_foo(Foo $a) {
}

$foo = new Foo;
$bar = new Bar;

type_hint_foo($foo);
type_hint_foo($bar);

?>
--EXPECTF--
Fatal error: Uncaught TypeError: type_hint_foo() expects argument #1 ($a) to be of type Foo, Bar given, called in %s on line 16 and defined in %s:9
Stack trace:
#0 %s(%d): type_hint_foo(Object(Bar))
#1 {main}
  thrown in %s on line 9