Hello!

Just a question.
Would this also be allowed?

https://3v4l.org/RGdIA
<?php

class A {public int $i = 42;}
const BARE_CONSTANT = new A;
class B {
    const ClassConstant = BARE_CONSTANT;
}
class C {
    const ClassConstantViaPropertyFetching1 = BARE_CONSTANT->i;
    const ClassConstantViaPropertyFetching2 = B::ClassConstant->i;
}

Thanks!

--
Shinji Igarashi

2022年5月28日(土) 18:44 Ilija Tovilo <tovilo.il...@gmail.com>:

>
> Hi everyone
>
> I'd like to start a discussion on a simple RFC to allow fetching
> properties in constant expressions.
> https://wiki.php.net/rfc/fetch_property_in_const_expressions
>
> The RFC proposes adding support for fetching properties in constant
> expressions using the -> operator. I'm looking forward to your
> feedback.
>
> Regards,
> Ilija
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to