Re: [RFC][Dynamic class constant fetch]

From: Date: Fri, 04 Nov 2022 15:07:42 +0000
Subject: Re: [RFC][Dynamic class constant fetch]
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-118967@lists.php.net to get a copy of this message
> What's convenient about Foo::{$bar} vs > `constant(Foo::class . '::' . > $bar)`? I'm a bit confused by this :| > > Is it the few keystrokes added? Even if ignoring syntax / convenience bikeshedding, I find it a really valuable addition to the language self-consistency. It's symmetrical to the already existing syntax of dynamic property fetch and dynamic method calls. One could argue that it's dynamic, too much magic and bad, but then we should either deprecate those features, or if not, have this symmetry. The Principle of Least Amusement and human pattern recognition overall with thank you.

« previous php.internals (#118967) next »