[php-src] Issue #10224: New static magic methods akin to __callStatic and inactive RFC question
| From: | aetonsi | Date: | Wed, 04 Jan 2023 22:17:26 +0000 |
| Subject: | [php-src] Issue #10224: New static magic methods akin to __callStatic and inactive RFC question | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243337@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10224
Author: aetonsi
### Description
Hello
this post is about RFCs and, in particular, the possibility of implementing the a few new
static magic methods: __constructStatic, __getStatic and
__setStatic.
The names are pretty self explanatory if you know what does __callStatic do, and/or if
you know how they work in other languages that have them (especially the static constructor, see
[Static Constructors (C# Programming
Guide)](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-constructors),
or even this post [Static Constructors **in
PHP**](https://liamhammett.com/static-constructors-in-php-y0zPVbQl)).
There are already some php implementations relying on composer: https://github.com/vladimmi/construct-static
or https://github.com/NxtLvLSoftware/php-static-constructors.
This concept has already been "officially" [discussed in the
past](https://bugs.php.net/bug.php?id=62860) and the last message by mr Becker states that an RFC is
required. I've looked around and the only _kinda_ related RFC i've found is this: [PHP
RFC: Static Class Constructor](https://wiki.php.net/rfc/static_class_constructor). It proposed the
change for php 7.x, it is now "inactive", and the proposal was limited to the constructor
(which was not called __constructStatic).
So my questions are:
- First of all, what do you think about this concept? I personally think that it just makes sense,
even simply due to the fact that __callStatic exists. It's wouldn't even be
an impacting feature. The big question to me would be how many users need it, as for any feature...
- How do you go about all of this and that RFC? Since the RFC is inactive and targeted an surpassed
php version, what can you do? Is it still possible to propose changes?
- Since the RFC doesn't cover all of these related proposed methods, is a new RFC necessary?
Thank you for your time
---
Have a nice day