> On Jan 2, 2020, at 7:09 PM, tyson andre <tysonandre...@hotmail.com> wrote:
> 
>> The problem with using constants is that the value is still hardcoded
>> and if we later want to change to pulling the data from a config file 
>> we have to change all the code that uses those constants. 
> 
> It's possible to work around this by using a unique constant name
> and define('unique_name', $dynamicExpression)
> (and const MY_CLASS_CONST = \unique_name;)

I do appreciate the attempt to come up with something that is a workaround.

That said, I definitely do not want to do is start using "clever" code in my 
implementations because — one day — someone else will have to maintain what I 
write.

Really, I was just asking for a discussion of potentially allowing for one-time 
initialization via code for constants and via a straightforward, obvious syntax 
and standardized syntax.  

Effectively I am just asking for immutable static values in a class that can be 
access vis the <Class>::<ImmutableValue> syntax.

-Mike

Reply via email to