summaryrefslogtreecommitdiff
path: root/tests/lang/type_hints_001.phpt
blob: 2aea3e703ee239146d047209bd752977a4649184 (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
--TEST--
ZE2 type hinting
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--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: Argument 1 must be an instance of Foo, called in %s on line 16 and defined in %s on line 9