Le 26/10/2012 11:37, Clint Priest a écrit :
I'm opening up several new threads to get discussion going on the
remaining "being debated" categories referenced in this 1.1 -> 1.2
change spec:
https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented/change-requests
In the RFC, section "read
ed:private $aaa; // protected reading, private writing
protected:const $bbb; // protected reading, no writing
I read all the messages on the property accessors. And I really agree
with the solution of Amaury. It is a nice solution: not verbose, not
slower, just covers most of developper's needs.
C
Le 12/10/2012 11:48, Nikita Popov a écrit :
I've been thinking a bit about the automatic properties again, and
noticed that I forgot to name one use case: Asymmetric accessor
visibility. Automatic properties may be useful in that context, so
that you can write "public $foo { get; protected set;
(Let me suggest an idea irrelevant. Sorry...)
The performance of getters is critical.
For me the best solution would be a new keyword, equivalent to a "var"
without write access from outside the class:
class TimePeriod {
*property* $Hours = 1;
public function setHours($h) {