summaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2006-05-10 22:38:35 +0000
committerMarcus Boerger <helly@php.net>2006-05-10 22:38:35 +0000
commit23b97b2530a3d0f84dda19a3ede325fdec5d8b45 (patch)
treebad45598c67b3c3f185acbcba6f0760a133270cc /tests/lang
parentde9fa58e0bdcd9c1f34846507dc8f3c3c17e1ff8 (diff)
downloadphp-git-23b97b2530a3d0f84dda19a3ede325fdec5d8b45.tar.gz
- Update tests after MFH
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/bug24658.phpt2
-rw-r--r--tests/lang/type_hints_001.phpt2
-rw-r--r--tests/lang/type_hints_002.phpt28
-rw-r--r--tests/lang/type_hints_003.phpt14
4 files changed, 44 insertions, 2 deletions
diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt
index d9bf0f5668..5f3b324b61 100644
--- a/tests/lang/bug24658.phpt
+++ b/tests/lang/bug24658.phpt
@@ -53,4 +53,4 @@ int(2)
object(foo)#%d (0) {
}
-Fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
+Catchable fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt
index 2b5f6c8287..dc14706a36 100644
--- a/tests/lang/type_hints_001.phpt
+++ b/tests/lang/type_hints_001.phpt
@@ -23,4 +23,4 @@ type_hint_foo($bar);
?>
--EXPECTF--
-Fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
+Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, called in %s on line 16 and defined in %s on line 9
diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt
new file mode 100644
index 0000000000..b21240a792
--- /dev/null
+++ b/tests/lang/type_hints_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class P { }
+class T {
+ function f(P $p = NULL) {
+ var_dump($p);
+ echo "-\n";
+ }
+}
+
+$o=new T();
+$o->f(new P);
+$o->f();
+$o->f(NULL);
+?>
+--EXPECT--
+object(P)#2 (0) {
+}
+-
+NULL
+-
+NULL
+-
+
diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt
new file mode 100644
index 0000000000..0ef3e3516b
--- /dev/null
+++ b/tests/lang/type_hints_003.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class T {
+ function f(P $p = 42) {
+ }
+}
+?>
+--EXPECTF--
+
+Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3