summaryrefslogtreecommitdiff
path: root/Zend/tests/bug60573_2.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug60573_2.phpt')
-rw-r--r--Zend/tests/bug60573_2.phpt64
1 files changed, 64 insertions, 0 deletions
diff --git a/Zend/tests/bug60573_2.phpt b/Zend/tests/bug60573_2.phpt
new file mode 100644
index 0000000000..221745316a
--- /dev/null
+++ b/Zend/tests/bug60573_2.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Bug #60573 (type hinting with "self" keyword causes weird errors) -- variation 2
+--FILE--
+<?php
+class Foo1 {
+
+public function setSelf(self $s) { }
+
+}
+
+class Bar1 extends Foo1 {
+
+public function setSelf(parent $s) { }
+
+}
+
+class Foo2 {
+
+public function setSelf(Foo2 $s) { }
+
+}
+
+class Bar2 extends Foo2 {
+
+public function setSelf(parent $s) { }
+
+}
+
+class Base {
+}
+
+class Foo3 extends Base{
+
+public function setSelf(parent $s) { }
+
+}
+
+class Bar3 extends Foo3 {
+
+public function setSelf(Base $s) { }
+
+}
+
+class Foo4 {
+
+public function setSelf(self $s) { }
+
+}
+
+class Foo5 extends Base {
+
+public function setSelf(parent $s) { }
+
+}
+
+class Bar5 extends Foo5 {
+
+public function setSelf(parent $s) { }
+
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of Bar5::setSelf(Foo5 $s) must be compatible with Foo5::setSelf(Base $s) in %sbug60573_2.php on line %d