Re: [PHP-DEV] [RFC] Static Constructor

2024-08-28 Thread Erick de Azevedo Lima
Hello, everyone. I'm sorry for not being active for a time on the internals, including about this RFC of mine. I just had a huge house-related problem and recently also health problems with my family. So, I'll have to stay away for some time. But I'll go ahead with the talks about this RFC as soon

Re: [PHP-DEV] [RFC] Static Constructor

2024-08-27 Thread Morgan
On 2024-08-28 09:51, Bilge wrote: On 19/06/2024 19:25, Tim Düsterhus wrote: Hi On 6/19/24 16:03, Erick de Azevedo Lima wrote: I have considered some names, actually. I just chose this one for the implementation because I tried to design it to be as close as possible to the C# implementation an

Re: [PHP-DEV] [RFC] Static Constructor

2024-08-27 Thread Bilge
On 19/06/2024 19:25, Tim Düsterhus wrote: Hi On 6/19/24 16:03, Erick de Azevedo Lima wrote: I have considered some names, actually. I just chose this one for the implementation because I tried to design it to be as close as possible to the C# implementation and they call it "static constructor"

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-20 Thread Rowan Tommins [IMSoP]
On 19/06/2024 13:33, Erick de Azevedo Lima wrote: I searched internals and found a discussion from almost a decade ago. That discussion did not end well, mostly because of insulting accusations. If you're talking about the March/April 2015 thread, I don't think that's a fair summary. There we

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-20 Thread Mike Schinkel
> On Jun 20, 2024, at 9:01 AM, Erick de Azevedo Lima > wrot > Mike again: > > > Consider that some uses for a static function need to always occur no matter > > whether or not any other method of the class is called. My previous email > > [1] covered several. > > Here [2] is a discussion on Sta

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-20 Thread Jorg Sowa
Hi Erick, It would be useful to include the example of Singleton implementation with a static constructor. Kind regards, Jorg

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-20 Thread Erick de Azevedo Lima
Hi all. Answering to Larry: > More complex initialization of things like lookup tables or "dynamic constants" (like if you wanted to record "now" to use for later comparisons). Those are my use cases, to be honest. > For that reason, therefore, I don't like the current approach, especially for th

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-20 Thread Lynn
On Wed, Jun 19, 2024 at 11:57 PM Mike Schinkel wrote: > On Jun 19, 2024, at 2:36 PM, Ilija Tovilo wrote: > On Wed, Jun 19, 2024 at 2:34 PM Erick de Azevedo Lima > wrote: > > New expressions continue to not be supported in (static and non-static) > property initializers and class constant initia

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Mike Schinkel
> On Jun 19, 2024, at 2:36 PM, Ilija Tovilo wrote: > On Wed, Jun 19, 2024 at 2:34 PM Erick de Azevedo Lima > wrote: >> New expressions continue to not be supported in (static and non-static) >> property initializers and class constant initializers. The reasons for this >> are twofold: >> [snip]

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Ilija Tovilo
Hi Erick On Wed, Jun 19, 2024 at 2:34 PM Erick de Azevedo Lima wrote: > > You can read the RFC here: > https://wiki.php.net/rfc/static_constructor I see that you're using zend_class_init_statics() as a hook to call __static_construct(). This makes the initialization order unpredictable, because

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Tim Düsterhus
Hi On 6/19/24 16:03, Erick de Azevedo Lima wrote: I have considered some names, actually. I just chose this one for the implementation because I tried to design it to be as close as possible to the C# implementation and they call it "static constructor". But the name can be changed to another on

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Mike Schinkel
> On Jun 19, 2024, at 8:33 AM, Erick de Azevedo Lima > wrote: > > Hello everybody. > > I found myself wanting this feature (that I first encountered when > programming in C#) for removing a workaround from a codebase I work from time > to time. > I searched int

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Larry Garfield
On Wed, Jun 19, 2024, at 7:33 AM, Erick de Azevedo Lima wrote: > Hello everybody. > > I found myself wanting this feature (that I first encountered when > programming in C#) for removing a workaround from a codebase I work > from time to time. > I searched internals and found a discussion from al

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Erick de Azevedo Lima
Hi, Michał. > Have you considered naming it for example shortly `function __static()` ? I have considered some names, actually. I just chose this one for the implementation because I tried to design it to be as close as possible to the C# implementation and they call it "static constructor". But

Re: [PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Michał Marcin Brzuchalski
Hi Erick, śr., 19 cze 2024 o 14:35 Erick de Azevedo Lima napisał(a): > Hello everybody. > > I found myself wanting this feature (that I first encountered when > programming in C#) for removing a workaround from a codebase I work from > time to time. > I searched internals and found a discussion

[PHP-DEV] [RFC] Static Constructor

2024-06-19 Thread Erick de Azevedo Lima
Hello everybody. I found myself wanting this feature (that I first encountered when programming in C#) for removing a workaround from a codebase I work from time to time. I searched internals and found a discussion from almost a decade ago. That discussion did not end well, mostly because of insul