1--TEST--
2GH-15644: Asymmetric visibility doesn't work for set hook
3--FILE--
4<?php
5
6class C {
7    public private(set) string $prop1 {
8        set => $value;
9    }
10    public private(set) string $prop2 {
11        get => $this->prop2;
12    }
13}
14
15$c = new C();
16
17try {
18    $c->prop1 = 'hello world';
19} catch (Error $e) {
20    echo $e->getMessage(), "\n";
21}
22
23try {
24    $c->prop2 = 'hello world';
25} catch (Error $e) {
26    echo $e->getMessage(), "\n";
27}
28
29?>
30--EXPECT--
31Cannot modify private(set) property C::$prop1 from global scope
32Cannot modify private(set) property C::$prop2 from global scope
33