1--TEST--
2Reads and writes from backing store are only cached for $this
3--FILE--
4<?php
5
6class C {
7    public $switch;
8
9    public $prop = 42 {
10        get {
11            echo __METHOD__, "\n";
12            if ($this->switch) {
13                $other = new C();
14                $other->switch = false;
15            } else {
16                $other = $this;
17            }
18            var_dump($other->prop);
19            return 1;
20        }
21        set => $this->prop;
22    }
23}
24
25function test() {
26    $c = new C();
27    $c->switch = true;
28    var_dump($c->prop);
29}
30
31test();
32test();
33
34?>
35--EXPECT--
36C::$prop::get
37C::$prop::get
38int(42)
39int(1)
40int(1)
41C::$prop::get
42C::$prop::get
43int(42)
44int(1)
45int(1)
46