Hi Claude,
> Although they are not explicitly mentioned, I assume that typed constants
> are also available on traits?
>
Yes, sure! I've just clarified the RFC by mentioning this fact as well as
adding an example.
Regards,
Máté
> Le 23 févr. 2023 à 16:51, Máté Kocsis a écrit :
>
> As the RFC text is now finalized, I intend to start the vote on Monday.
>
> Regards,
> Máté
Hi Máté,
I’ve just read the new version of the RFC. It seems ok to me. Just a small
remark:
Although they are not explicitly mentioned, I assume
Hey Claude,
Sorry for my last response, I didn't understand you indeed... Enums really
do support self/static types. So I've just updated the implementation +
removed the restrictions
in question from the RFC + added a future scope section containing some
information about the existing restriction
Hi Claude,
No, I didn't misunderstand you, I just didn't specify my answer enough:
Enums can be assigned to their own class constants because of their special
behavior, namely that enum cases are evaluated and then instantiated right
away,
during the compilation of the enum case. This is easily p
Hi Máté,
I think you didn’t understand me, so I’ll restate:
> To be exact, defining class constants with the class itself as value is
> already impossible: https://3v4l.org/J7C30
No, for some specific sort of class, namely for enum, it is absolutely possible
to define a constant with an effec
Hi Claude,
The RFC states that it is technically not possible to have a constant of
> effective type `static` or `self`. While this is probably correct for
> regular classes, this is not true for enums. The following code ostensibly
> works (https://3v4l.org/84W92):
>
To be exact, defining class
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 this scenario,
>
> I've added som
Benas,
On Sun, Feb 5, 2023 at 9:29 AM Benas IML wrote:
> [copy of the email that I have accidentally sent to Mark individually]
>
> Hey,
>
> As much as I appreciate your enthusiasm and ideas, adding your name on
> my original RFC and editing its contents without my approval is not
> acceptable.
[copy of the email that I have accidentally sent to Mark individually]
Hey,
As much as I appreciate your enthusiasm and ideas, adding your name on
my original RFC and editing its contents without my approval is not
acceptable. Especially considering that contents of the RFCs are a
direct represen
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 this scenario,
I've added some notes on the page https://wiki.php.net/rfc/howto
I had some words alrea
Máté, Benas, Internals,
On Fri, Feb 3, 2023 at 7:34 AM Máté Kocsis wrote:
> Hi Alexandru, Mark,
>
>
> > 1. Why is object type not supported? I can't see a real reason and also
> > there is no explanation why.
> >
>
> Sorry for this, mentioning object as unsupported was an artifact from the
> ori
> Le 31 janv. 2023 à 22:01, Máté Kocsis a écrit :
>
>
> Please find the updated RFC here:
> https://wiki.php.net/rfc/typed_class_constants.
>
> Regards,
> Máté
Hi,
The RFC states that it is technically not possible to have a constant of
effective type `static` or `self`. While this is pro
On Fri, Feb 3, 2023 at 11:34 AM Máté Kocsis wrote:
> Hi Alexandru, Mark,
>
>
> > 1. Why is object type not supported? I can't see a real reason and also
> > there is no explanation why.
> >
>
> Sorry for this, mentioning object as unsupported was an artifact from the
> original version of the RFC
Hi Alexandru, Mark,
> 1. Why is object type not supported? I can't see a real reason and also
> there is no explanation why.
>
Sorry for this, mentioning object as unsupported was an artifact from the
original version of the RFC which
was created back then when constants couldn't be objects. Aft
On Tue, Jan 31, 2023 at 11:01 PM Máté Kocsis wrote:
> Hi Everyone,
>
> A few years ago, Benas Seliuginas announced the "Typed constants" RFC (
> https://externals.io/message/110755) which apparently had a
> positive reception overall.
> Unfortunately, there were some issues with the implementatio
I initiated a conversation about the typed constants RFC back in March
2022: https://externals.io/message/117406
I had updated the RFC page, but it looks like the changes were reverted in
December 2022. The updated version I was working on was:
https://wiki.php.net/rfc/typed_class_constants?rev=16
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 static:: or $object::.
On Tue 31. 1. 2023 at 22:01, Máté Kocsis wrote:
> Hi Everyone,
>
> A few years ago,
On Tue, Jan 31, 2023, at 3:01 PM, Máté Kocsis wrote:
> Hi Everyone,
>
> A few years ago, Benas Seliuginas announced the "Typed constants" RFC (
> https://externals.io/message/110755) which apparently had a
> positive reception overall.
> Unfortunately, there were some issues with the implementation
Hi Everyone,
A few years ago, Benas Seliuginas announced the "Typed constants" RFC (
https://externals.io/message/110755) which apparently had a
positive reception overall.
Unfortunately, there were some issues with the implementation (namely, with
the parser)
so the RFC was stuck.
A few weeks ag
19 matches
Mail list logo