summaryrefslogtreecommitdiff
path: root/Zend/tests/bug75079.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-01-15 12:13:55 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-01-15 12:15:40 +0100
commit20233469737ba007a1bdd38b7acd5512a2e7d534 (patch)
treebc0e820962e864fce6ac9adb12149db7d9f78a18 /Zend/tests/bug75079.phpt
parent089a3213ae9f0b61b19a4dc77897fa07da5298f3 (diff)
downloadphp-git-20233469737ba007a1bdd38b7acd5512a2e7d534.tar.gz
Fixed bug #75079
Diffstat (limited to 'Zend/tests/bug75079.phpt')
-rw-r--r--Zend/tests/bug75079.phpt39
1 files changed, 39 insertions, 0 deletions
diff --git a/Zend/tests/bug75079.phpt b/Zend/tests/bug75079.phpt
new file mode 100644
index 0000000000..9bf9c1ddb8
--- /dev/null
+++ b/Zend/tests/bug75079.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #75079: self keyword leads to incorrectly generated TypeError when in closure in trait
+--FILE--
+<?php
+
+trait Foo
+{
+ public function selfDo(self ...$Selfs)
+ {
+ array_map(
+ function (self $Self) : self
+ {
+ return $Self;
+ },
+ $Selfs
+ );
+ }
+}
+
+class Bar
+{
+ use Foo;
+}
+
+class Baz
+{
+ use Foo;
+}
+
+$Bar = new Bar;
+$Baz = new Baz;
+
+$Bar->selfDo($Bar, $Bar);
+$Baz->selfDo($Baz, $Baz);
+
+?>
+===DONE===
+--EXPECT--
+===DONE===