[RFC] [Vote] Final constants

php.internals

Máté Kocsis

5 years ago
Hi Internals, 2 weeks of discussion period has passed, so I'm opening the vote. RFC link: https://wiki.php.net/rfc/final_class_const, previous threads: https://externals.io/message/114066, https://externals.io/message/114273 The vote will be closed on 2021-06-02. Regards: Máté

Girgias

5 years ago
On Wed, 19 May 2021 at 09:03, Máté Kocsis <kocsismate90@gmail.com> wrote:
> Hi Internals, > > 2 weeks of discussion period has passed, so I'm opening the vote. RFC link: > https://wiki.php.net/rfc/final_class_const, previous threads: > https://externals.io/message/114066, https://externals.io/message/114273 > > The vote will be closed on 2021-06-02. > > Regards: > Máté >
I'm voting against this because it makes interface constants overridable by default. And this means now an interface which extends another one can override the value of it, something which is currently not possible: https://3v4l.org/l4OOB The current behaviour for classes might be unfortunate but can make sense. If this would only target class constants my vote would probably be different. Best regards, George P. Banyard

Máté Kocsis

5 years ago
Hi George, Being able to override interface constants by default might seem like a regression, but I believe making interface constant behavior consistent with class constants is worth this, and also, I don't see any other good way to fix the weird inheritance behavior Nikita highlighted than to do what the RFC currently proposes. Regards: Máté

Máté Kocsis

5 years ago
Hi Internals, I've just closed the vote, and the RFC is accepted with 28 votes in favor and 4 against. Regards: Máté Máté Kocsis <kocsismate90@gmail.com> ezt írta (időpont: 2021. máj. 24., H, 10:14):