Re: [PHP-DEV] [RFC] [Discussion] Typed class constants

2023-02-06 Thread Mark Niebergall
Dan, On Sat, Feb 4, 2023 at 8:34 AM Dan Ackroyd wrote: > Hi Mark, > > On Sat, 4 Feb 2023 at 00:22, Mark Niebergall > wrote: > > > > This is also a bigger policy question for other seemingly-abandoned > > RFCs. If it is agreed that a new RFC should be created in

Re: [PHP-DEV] [RFC] [Discussion] Typed class constants

2023-02-06 Thread Mark Niebergall
I will be doing that. I'll give the typed constants RFC time to settle first. > > Best regards, > Benas > > P.S.: Next time, try also contacting me over Room 11 or GitHub, given > that I rarely check this email. > > Thanks for the updated contact information. &g

Re: [PHP-DEV] [RFC] [Discussion] Typed class constants

2023-02-03 Thread Mark Niebergall
off > the project, I'll surely try to review your work. > That is fine to break it apart as a future RFC. I have seen too many real world use cases where inheritance with typed constants would solve problems. See https://externals.io/message/117406#117408 for an explanation. Adding typed constants independently adds value, so it should progress. > > Regards, > Máté Kocsis > Overall, I'm happy to see that this is progressing again, thanks for working on it. - Mark Niebergall

Re: [PHP-DEV] [RFC] [Discussion] Typed class constants

2023-01-31 Thread Mark Niebergall
concrete class. - Mark Niebergall On Tue, Jan 31, 2023 at 5:55 PM Ondřej Mirtes wrote: > I fully support this RFC. PHPStan added support for PHPDoc types in class > constants some time ago - it’s useful to rely on the same constant type > even in subclasses when accessing them via stati

Re: [PHP-DEV] Typed constants revisited

2022-03-30 Thread Mark Niebergall
Guilliam, On Wed, Mar 30, 2022 at 7:50 AM Guilliam Xavier wrote: > Hi Mark, > > I have updated the RFC https://wiki.php.net/rfc/typed_class_constants with more details and examples from this thread, and updated the RFC status to Under Discussion. Hopefully the updated RFC helps an

Re: [PHP-DEV] Typed constants revisited

2022-03-30 Thread Mark Niebergall
Alex, On Wed, Mar 30, 2022 at 7:47 AM Alexandru Pătrănescu wrote: > Hey Mark, > > On Wed, Mar 30, 2022 at 4:01 PM Mark Niebergall > wrote: > >> Alex, >> >> On Tue, Mar 29, 2022 at 10:35 PM Alexandru Pătrănescu >> wrote: >> >>> Hey

Re: [PHP-DEV] Typed constants revisited

2022-03-30 Thread Mark Niebergall
Alex, On Tue, Mar 29, 2022 at 10:35 PM Alexandru Pătrănescu wrote: > Hey Mark, > > > On Wed, Mar 30, 2022 at 6:03 AM Mark Niebergall > wrote: > >> >> I have updated the RFC https://wiki.php.net/rfc/typed_class_constants >> with >> more details and exam

Re: [PHP-DEV] Typed constants revisited

2022-03-29 Thread Mark Niebergall
On Mon, Mar 28, 2022 at 6:54 AM Guilliam Xavier wrote: > Constants are not abstract in an interface - they must be assigned a >> value. Only classes and methods can be abstract. Within an abstract class >> it is not valid to have an abstract property. Properties can be defined >> `protected int $

Re: [PHP-DEV] Typed constants revisited

2022-03-25 Thread Mark Niebergall
On Fri, Mar 25, 2022 at 10:55 AM Guilliam Xavier wrote: > I intentionally left `abstract` out of `public const bool CAN_FLY;` in the >> `abstract class` for consistency with the implementation with `interface`, >> which would also have to be `public const bool CAN_FLY;`. Currently >> `abstract` i

[PHP-DEV] Requesting wiki, RFC karma

2022-03-25 Thread Mark Niebergall
in PHP for ~17 years. Plans - I'm picking up the typed constants RFC where it was left off, planning to create a new RFC for this go around. I have a few other future ideas I've also been tinkering with and plan to create several other RFCs in the future. Username: mbniebergall Tha

Re: [PHP-DEV] Typed constants revisited

2022-03-25 Thread Mark Niebergall
Guilliam, On Fri, Mar 25, 2022 at 6:35 AM Guilliam Xavier wrote: > Hi Mark, > > On Wed, Mar 23, 2022 at 11:55 PM Mark Niebergall > wrote: > >> (...) >> >> Another example I often see in my projects could be used with a similar >> example: >> >

Re: [PHP-DEV] Typed constants revisited

2022-03-24 Thread Mark Niebergall
On Thu, Mar 24, 2022 at 1:00 PM Rowan Tommins wrote: > On 23/03/2022 18:54, Mark Niebergall wrote: > > The next phase of work with different RFC would take > > this further with const inheritance, where const type must match. > > > I'm not sure it makes much sens

Re: [PHP-DEV] Typed constants revisited

2022-03-24 Thread Mark Niebergall
Pierre, On Thu, Mar 24, 2022 at 9:20 AM Pierre wrote: > Le 24/03/2022 à 16:06, Mark Niebergall a écrit : > > So you are correct, the const value does have a value that has a type, > but > > there is no way to enforce which type the value is or to use const with > > inher

Re: [PHP-DEV] Typed constants revisited

2022-03-24 Thread Mark Niebergall
Pierre, On Thu, Mar 24, 2022 at 1:04 AM Pierre wrote: > Le 23/03/2022 à 23:10, Larry Garfield a écrit : > > Is there a benefit to it other than "well everything else has types now, > so..."? Even if it's esoteric, like in reflection-based meta programming? > (I've been dabbling too much in that

Re: [PHP-DEV] Typed constants revisited

2022-03-23 Thread Mark Niebergall
On Wed, Mar 23, 2022 at 4:10 PM Larry Garfield wrote: > On Wed, Mar 23, 2022, at 1:54 PM, Mark Niebergall wrote: > > Hello All, > > > > In June 2020, Benas Seliuginas emailed this list ( > > https://externals.io/message/110755#110755) to gauge interest in typed &

[PHP-DEV] Typed constants revisited

2022-03-23 Thread Mark Niebergall
Hello All, In June 2020, Benas Seliuginas emailed this list ( https://externals.io/message/110755#110755) to gauge interest in typed constants. An RFC (https://wiki.php.net/rfc/typed_class_constants) was started and had an accompanying PR (https://github.com/php/php-src/pull/5815). At the time, Ni