diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-01-15 12:13:55 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-01-15 12:15:40 +0100 |
commit | 20233469737ba007a1bdd38b7acd5512a2e7d534 (patch) | |
tree | bc0e820962e864fce6ac9adb12149db7d9f78a18 /Zend/tests/bug75079.phpt | |
parent | 089a3213ae9f0b61b19a4dc77897fa07da5298f3 (diff) | |
download | php-git-20233469737ba007a1bdd38b7acd5512a2e7d534.tar.gz |
Fixed bug #75079
Diffstat (limited to 'Zend/tests/bug75079.phpt')
-rw-r--r-- | Zend/tests/bug75079.phpt | 39 |
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=== |