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