1--TEST--
2Assign on object inside property hook is ok
3--FILE--
4<?php
5
6class A implements ArrayAccess {
7    public $b;
8
9    public function offsetExists(mixed $offset): bool { return true; }
10    public function offsetGet(mixed $offset): mixed { return $offset; }
11    public function offsetSet(mixed $offset, $value): void {
12        echo "Setting $offset => $value\n";
13    }
14    public function offsetUnset(mixed $offset): void {
15        echo "Unsetting $offset\n";
16    }
17}
18
19class C {
20    public $a {
21        get { return $this->a; }
22        set { $this->a = $value; }
23    }
24}
25
26$c = new C;
27$c->a = new A();
28
29$c->a->b = 'b';
30var_dump($c->a->b);
31
32var_dump($c->a['foo']);
33$c->a['foo'] = 'foo';
34unset($c->a['foo']);
35
36?>
37--EXPECT--
38string(1) "b"
39string(3) "foo"
40Setting foo => foo
41Unsetting foo
42