diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2018-07-04 19:50:34 +0200 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2018-07-04 19:50:34 +0200 |
commit | 6337af09dc476ce6c5da951e7e01b4592d272531 (patch) | |
tree | 21ff8af7d123646803889c1b8990d1e6105efc99 /Zend/tests/traits | |
parent | 4a475a4976db92e71949786cdf5990c61514261e (diff) | |
download | php-git-6337af09dc476ce6c5da951e7e01b4592d272531.tar.gz |
Added test case for bug #76539 for master only as the behavior has been restored
Diffstat (limited to 'Zend/tests/traits')
-rw-r--r-- | Zend/tests/traits/bug76539.phpt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Zend/tests/traits/bug76539.phpt b/Zend/tests/traits/bug76539.phpt new file mode 100644 index 0000000000..51a75cdaf6 --- /dev/null +++ b/Zend/tests/traits/bug76539.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #76539 (Trait attribute is set incorrectly when using self::class with another string) +--FILE-- +<?php +trait MyTrait { + protected $attr = self::class . 'Test'; + + public function test() { + echo $this->attr, PHP_EOL; + } +} + +class A { + use MyTrait; +} + +class B { + use MyTrait; +} + +(new A())->test(); +(new B())->test(); +?> +--EXPECT-- +ATest +BTest |