xref: /PHP-8.2/Zend/tests/traits/bug76539.phpt (revision f8d79582)
1--TEST--
2Bug #76539 (Trait attribute is set incorrectly when using self::class with another string)
3--FILE--
4<?php
5trait MyTrait {
6    protected $attr = self::class . 'Test';
7
8    public function test() {
9        echo $this->attr, PHP_EOL;
10    }
11}
12
13class A {
14    use MyTrait;
15}
16
17class B {
18    use MyTrait;
19}
20
21(new A())->test();
22(new B())->test();
23?>
24--EXPECT--
25ATest
26BTest
27