mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
25 lines
306 B
PHP
25 lines
306 B
PHP
--TEST--
|
|
Asymmetric visibility nested write
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
public private(set) Bar $bar;
|
|
|
|
public function __construct() {
|
|
$this->bar = new Bar;
|
|
}
|
|
}
|
|
|
|
class Bar {
|
|
public int $baz;
|
|
}
|
|
|
|
$foo = new Foo();
|
|
$foo->bar->baz = 42;
|
|
var_dump($foo->bar->baz);
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(42)
|