summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug76539.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/traits/bug76539.phpt')
-rw-r--r--Zend/tests/traits/bug76539.phpt26
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