1--TEST--
2Bug 002
3--FILE--
4<?php
5
6trait Foo {
7    public string $bar {
8        get => $this->getBar();
9    }
10
11    protected function getBar() {
12        return 'bar';
13    }
14}
15
16class A {
17    use Foo;
18}
19
20class B {
21    use Foo;
22}
23
24$a = new A();
25$b = new B();
26var_dump($a->bar);
27var_dump($b->bar);
28
29?>
30--EXPECT--
31string(3) "bar"
32string(3) "bar"
33