Re: RFC Proposal - static modifier for classes

From: Date: Mon, 20 Nov 2023 07:52:36 +0000
Subject: Re: RFC Proposal - static modifier for classes
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-121721@lists.php.net to get a copy of this message
On 19 November 2023 21:28:08 GMT, Lanre Waju <lanre@online-presence.ca> wrote: >Hi, similar to the abstract and readonly modifiers to classes (similar in syntax only), I >propose a class level "static" modifier that ensures: Hi Lanre, There was a proposal for this several years ago which was declined at the voting stage: https://wiki.php.net/rfc/abstract_final_class That doesn't mean we can't look again, but any new proposal would need to at least address the reasons the previous one was declined. I believe these are the relevant discussion threads: https://externals.io/message/79211 https://externals.io/message/79338 https://externals.io/message/79601 My memory is that one of the main points against was that a class with only static methods is just a namespace, and you can already put functions directly in a namespace. The only issue being that we don't have good autoloading support for such functions, and that's a whole different problem... Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#121721) next »