Re: [RFC] Static class
| From: | Jordi Boggiano | Date: | Wed, 26 Jun 2024 12:07:37 +0000 |
| Subject: | Re: [RFC] Static class | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123864@lists.php.net to get a copy of this message | ||
On 2024-06-24 01:10, Bilge wrote:
Yeah sorry that is indeed not needed as it already works that way https://3v4l.org/TYIiV It is not compile time though, but that's a separate concern. Jordi Boggiano @seldaek - https://seld.beOn second thoughts, I don't think dynamic properties can apply at all. The notion ofAbsolutely. I'll include a note about this in the RFC.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?).$thisis 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).