summaryrefslogtreecommitdiff
path: root/tests/classes
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-04-20 00:00:51 +0000
committerMarcus Boerger <helly@php.net>2004-04-20 00:00:51 +0000
commitdddbe6f60e8bf21b36da7a0b97e80df59d270a14 (patch)
tree5e33384b25fabd2329146439bb9af4533cf94e35 /tests/classes
parentf726dc7af1c6eebd7968cf9ff31ee663c460e744 (diff)
downloadphp-git-dddbe6f60e8bf21b36da7a0b97e80df59d270a14.tar.gz
Add new tests (by magnus)
Diffstat (limited to 'tests/classes')
-rwxr-xr-xtests/classes/interface_construct.phpt24
-rwxr-xr-xtests/classes/interface_optional_arg.phpt27
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/classes/interface_construct.phpt b/tests/classes/interface_construct.phpt
new file mode 100755
index 0000000000..406462e17a
--- /dev/null
+++ b/tests/classes/interface_construct.phpt
@@ -0,0 +1,24 @@
+--TEST--
+ZE2 An interface constructor signature must not be inherited
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+error_reporting(4095);
+
+interface test {
+ public function __construct($foo);
+}
+
+class foo implements test {
+ public function __construct() {
+ echo "foo\n";
+ }
+}
+
+$foo = new foo;
+
+?>
+--EXPECT--
+foo
+
diff --git a/tests/classes/interface_optional_arg.phpt b/tests/classes/interface_optional_arg.phpt
new file mode 100755
index 0000000000..05f2fc41df
--- /dev/null
+++ b/tests/classes/interface_optional_arg.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 An interface method allows additional default arguments
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+error_reporting(4095);
+
+interface test {
+ public function bar();
+}
+
+class foo implements test {
+
+ public function bar($foo = NULL) {
+ echo "foo\n";
+ }
+}
+
+$foo = new foo;
+$foo->bar();
+
+?>
+--EXPECT--
+foo
+