summaryrefslogtreecommitdiff
path: root/tests/lang/type_hints_001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/type_hints_001.phpt')
-rw-r--r--tests/lang/type_hints_001.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt
new file mode 100644
index 0000000..57808d4
--- /dev/null
+++ b/tests/lang/type_hints_001.phpt
@@ -0,0 +1,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--
+
+Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s on line 9