> On Jan 2, 2020, at 6:14 PM, Bruce Weirdan <weir...@gmail.com> wrote:
> 
> There's also a fourth approach that does not involve any changes to
> PHP: autoload + eval.
> When PHP is looking for your class, in your autoload you load the
> values from config, generate the class source and eval() it.

Yes, I guess that would technically be possible.  

But I think in this case — dynamically generated code, lack of type safety and 
inability to version control and statically analyze the code — the proposed 
solution would be worse than the fallback position of not using constants.

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

Reply via email to