Am 21.04.2021 um 17:08 schrieb Andreas Leathley :
> On 21.04.21 15:14, Christian Schneider wrote:
>> I never really understood the desire to restrict how people can use
>> your code.
>> If there is no good reason to override the value of a class constant people
>> won't do it.
>> If there might be
On 21.04.21 15:14, Christian Schneider wrote:
I never really understood the desire to restrict how people can use
your code.
If there is no good reason to override the value of a class constant people
won't do it.
If there might be a good reason (even one you as the original designer didn't
pre
Am 21.04.2021 um 14:25 schrieb Máté Kocsis :
>> My point is actually what’s your scenario for a final constant? If you
>> want to make sure the value you access are not changed by child class,
>> `self::` can serve the purpose already. If you want to make sure
>
>
> Yes, my intention is to actual
>
> My point is actually what’s your scenario for a final constant? If you
> want to make sure the value you access are not changed by child class,
> `self::` can serve the purpose already. If you want to make sure
Yes, my intention is to actually make class constant overriding impossible
when i
Can I ask why you use late static binding while you don't want your constant
value to be changed/overridden by child classes? IMHO, `self::FOO` is all you
need.
Personally, I don't use late static binding with class constants since the
coding standard rule I previously referenced forbids this,
>
> Can I ask why you use late static binding while you don't want your
> constant value to be changed/overridden by child classes? IMHO, `self::FOO`
> is all you need.
>
Personally, I don't use late static binding with class constants since the
coding standard rule I previously referenced forbids
rnals List
Subject: [PHP-DEV] [RFC] [Draft] Final constants
Hi Internals,
I've recently realized that class constant values cannot always be trusted when
late static binding is involved (e.g. static::FOO or $this::FOO), since they
can be freely overridden in child classes. That's
On Sun, Apr 18, 2021 at 4:20 PM Máté Kocsis wrote:
> Hi Internals,
>
> I've recently realized that class constant values cannot always be trusted
> when late static binding is involved (e.g. static::FOO or $this::FOO),
> since they can be freely overridden in child classes. That's why the engine
Hi Internals,
I've recently realized that class constant values cannot always be trusted
when late static binding is involved (e.g. static::FOO or $this::FOO),
since they can be freely overridden in child classes. That's why the engine
knows neither the type and the value before run-time.
Doctrin