summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug76539.phpt
blob: 0a6d893032cb1d1d723878ee12f79c900cf3d436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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