xref: /PHP-7.4/Zend/tests/traits/bug76539.phpt (revision 6337af09)
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