1--TEST--
2Asymmetric visibility reference in forbidden scope
3--FILE--
4<?php
5
6class C {
7    public private(set) int $prop = 1;
8}
9
10function test($c) {
11    $prop = &$c->prop;
12    $prop = 42;
13}
14
15try {
16    test(new C());
17} catch (Error $e) {
18    echo $e->getMessage(), "\n";
19}
20
21try {
22    test(new C());
23} catch (Error $e) {
24    echo $e->getMessage(), "\n";
25}
26
27?>
28--EXPECT--
29Cannot indirectly modify private(set) property C::$prop from global scope
30Cannot indirectly modify private(set) property C::$prop from global scope
31