1--TEST--
2Explicitly unset property with a-vis still respects set visibility
3--FILE--
4<?php
5
6class C {
7    public private(set) int $a = 1;
8    public function __construct() {
9        unset($this->a);
10    }
11}
12
13$c = new C();
14try {
15    $c->a = 2;
16} catch (Error $e) {
17    echo $e->getMessage(), "\n";
18}
19try {
20    unset($c->a);
21} catch (Error $e) {
22    echo $e->getMessage(), "\n";
23}
24
25?>
26--EXPECT--
27Cannot modify private(set) property C::$a from global scope
28Cannot unset private(set) property C::$a from global scope
29