We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a475a4 commit 6337af0Copy full SHA for 6337af0
Zend/tests/traits/bug76539.phpt
@@ -0,0 +1,26 @@
1
+--TEST--
2
+Bug #76539 (Trait attribute is set incorrectly when using self::class with another string)
3
+--FILE--
4
+<?php
5
+trait MyTrait {
6
+ protected $attr = self::class . 'Test';
7
+
8
+ public function test() {
9
+ echo $this->attr, PHP_EOL;
10
+ }
11
+}
12
13
+class A {
14
+ use MyTrait;
15
16
17
+class B {
18
19
20
21
+(new A())->test();
22
+(new B())->test();
23
+?>
24
+--EXPECT--
25
+ATest
26
+BTest
0 commit comments