Re: [RFC] Property write visibility

From: Date: Mon, 29 Jun 2020 14:13:24 +0000
Subject: Re: [RFC] Property write visibility
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-110777@lists.php.net to get a copy of this message
> > >> I agree that there is a use case for it, however I don't think the > proposed syntax public:private is intuitive. Maybe we can come > up with > something better? > Would something closer to Swift be better? If so I expanded the RFC with that syntax option as well: class User { public private(set) int $id; public protected(set) string $name; public function __construct(int $id, string $name) { $this->id = $id; $this->name = $name; }}

« previous php.internals (#110777) next »