--- /dev/null
+--TEST--
+ZE2 interfaces
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Throwable {
+ public function getMessage();
+}
+
+class Exception implements Throwable {
+ public $foo = "foo";
+
+ public function getMessage() {
+ return $this->foo;
+ }
+}
+
+$foo = new Exception;
+echo $foo->getMessage() . "\n";
+
+?>
+--EXPECT--
+foo
+
--- /dev/null
+--TEST--
+ZE2 interface with an unimplemented method
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Throwable {
+ public function getMessage();
+ public function getErrno();
+}
+
+class Exception implements Throwable {
+ public $foo = "foo";
+
+ public function getMessage() {
+ return $this->foo;
+ }
+}
+
+// this should die -- Exception class must be abstract...
+$foo = new Exception;
+echo $foo->getMessage() . "\n";
+
+?>
+--EXPECTF--
+
+Fatal error: Class exception contains abstract methods and must be declared abstract in %s on line %d
+
--- /dev/null
+--TEST--
+ZE2 class type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Foo {
+ function a(Foo $foo);
+}
+
+interface Bar {
+ function b(Bar $bar);
+}
+
+class FooBar implements Foo, Bar {
+ function a(Foo $foo) {
+ // ...
+ }
+
+ function b(Bar $bar) {
+ // ...
+ }
+}
+
+class Blort {
+}
+
+$a = new FooBar;
+$b = new Blort;
+
+$a->a($b);
+$a->b($b);
+
+?>
+--EXPECTF--
+
+Fatal error: Argument 1 must implement interface foo in %s on line %d
--- /dev/null
+--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 in %s on line %d