Re: [PHP-DEV] Static class

2024-06-15 Thread Marco Aurélio Deleu
> On 15 Jun 2024, at 14:11, Rowan Tommins [IMSoP] wrote: > > I fundamentally disagree with this assertion. > > If somebody makes a valid point, it doesn't automatically become invalid > because time has passed, or because nobody happens to repeat it in a later > e-mail thread. > > If I cop

Re: [PHP-DEV] Static class

2024-06-15 Thread Lanre
I proposed this previously and have a working implementation, though it may need some updates. However, I chose not to pursue it further because it was clear it wouldn't pass as many people here are unaware that PHP is a multi-paradigm language. I frequently use static classes because they allow m

Re: [PHP-DEV] Static class

2024-06-15 Thread Valentin Udaltsov
On Sat, 15 June, 2024 at 19:21, Bilge wrote: > On 15/06/2024 16:58, Rowan Tommins [IMSoP] wrote: > > Common arguments against: > > > > - Static properties are a form of global state, and that's something > > widely advised against > > Correct, but a static class does not need to have any state. I

Re: [PHP-DEV] Static class

2024-06-15 Thread Larry Garfield
On Sat, Jun 15, 2024, at 9:40 AM, Bilge wrote: > On 15/06/2024 14:53, Rowan Tommins [IMSoP] wrote: >> On 15/06/2024 12:16, Bilge wrote: >>> >>> I want to introduce the `static` keyword at the class declaration >>> level. That is, the following would be valid: `static class Foo {}`. >> >> >> This

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-15 Thread Larry Garfield
On Sat, Jun 15, 2024, at 8:28 AM, Arnaud Le Blanc wrote: > Hi Larry, > >> Under Common Behavior, you have an example of calling the constructor >> directly, using the reflection API, but not of binding the callable, which >> the text says is also available. Please include an example of that so

Re: [PHP-DEV] Static class

2024-06-15 Thread Rowan Tommins [IMSoP]
On 15/06/2024 17:17, Bilge wrote: You already provided a counter-point to this; we can't autoload functions. Just to reiterate, please do not attribute any of the arguments or counter-arguments to me. They were my attempt, from memory, to summarise previous discussions. Besides, there ma

Re: [PHP-DEV] Static class

2024-06-15 Thread Bilge
On 15/06/2024 16:58, Rowan Tommins [IMSoP] wrote: Common arguments against: - Static properties are a form of global state, and that's something widely advised against Correct, but a static class does not need to have any state. Indeed, I cannot think of an instance where I (personally) have

Re: [PHP-DEV] Static class

2024-06-15 Thread Rowan Tommins [IMSoP]
On 15/06/2024 15:40, Bilge wrote: That's all quite interesting, but I didn't get a good sense of why the idea was rejected I haven't re-read the threads in full, so this is mostly from old memories. And please note I am not saying which of these views I agree with, just attempting to summari

Re: [PHP-DEV] Static class

2024-06-15 Thread Rob Landers
On Sat, Jun 15, 2024, at 16:40, Bilge wrote: > On 15/06/2024 14:53, Rowan Tommins [IMSoP] wrote: > > On 15/06/2024 12:16, Bilge wrote: > >> > >> I want to introduce the `static` keyword at the class declaration > >> level. That is, the following would be valid: `static class Foo {}`. > > > > >

Re: [PHP-DEV] Static class

2024-06-15 Thread Bilge
On 15/06/2024 14:53, Rowan Tommins [IMSoP] wrote: On 15/06/2024 12:16, Bilge wrote: I want to introduce the `static` keyword at the class declaration level. That is, the following would be valid: `static class Foo {}`. This has been proposed before, and was rejected at vote. It was nearly

Re: [PHP-DEV] Static class

2024-06-15 Thread Rowan Tommins [IMSoP]
On 15/06/2024 12:16, Bilge wrote: I want to introduce the `static` keyword at the class declaration level. That is, the following would be valid: `static class Foo {}`. This has been proposed before, and was rejected at vote. It was nearly 10 years ago, so opinions may have changed, but it

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-15 Thread Arnaud Le Blanc
Hi Larry, On Fri, Jun 14, 2024 at 10:18 PM Larry Garfield wrote: > > The actual instance is allowed to escape the proxy and to create direct > > references to itself. > > How? Is this a "return $this" type of situation? This could use more > fleshing out and examples. "return $this" will ret

[PHP-DEV] Static class

2024-06-15 Thread Bilge
Hi Internals, I want to introduce the `static` keyword at the class declaration level. That is, the following would be valid: `static class Foo {}`. A "static class" is one that only permits static members (methods/properties) and could have similar semantics to a static class in C#