Re: [RFC] Static class

From: Date: Mon, 24 Jun 2024 21:14:34 +0000
Subject: Re: [RFC] Static class
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi again Jordi,

On 24/06/2024 21:21, Bilge wrote:
Hi Jordi, On 24/06/2024 13:22, Jordi Boggiano wrote:
On 2024-06-24 01:10, Bilge wrote:
I am pleased to present my first RFC: Static class <https://wiki.php.net/rfc/static_class>.
Just one point of feedback: for clarity I think it would be good if it mentions that creating dynamic properties i.e. $this->dynamicProp = 'bar' would also throw at runtime (or even compile time if doable?).
Absolutely. I'll include a note about this in the RFC.
On second thoughts, I don't think dynamic properties can apply at all. The notion of $this is a reference to an object instance; static classes cannot be instantiated, so the concept of dynamic properties simply cannot exist, and that's really all there is to it 😅 (unless I'm missing something). Cheers, Bilge

Thread (71 messages)

« previous php.internals (#123790) next »