<?php class Foo { public function __construct( public string $bar { set (string $s) { $this->bar = strtoupper($s); } } ) { } } $foo = new Foo("bar"); echo $foo->bar . "\n"; $foo->bar = "baz"; echo $foo->bar . "\n";
You have javascript disabled. You will not be able to edit any code.