Skip to content

Commit 6337af0

Browse files
committed
Added test case for bug #76539 for master only as the behavior has been restored
1 parent 4a475a4 commit 6337af0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Zend/tests/traits/bug76539.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
use MyTrait;
19+
}
20+
21+
(new A())->test();
22+
(new B())->test();
23+
?>
24+
--EXPECT--
25+
ATest
26+
BTest

0 commit comments

Comments
 (0)