On Fri, Nov 4, 2022 at 12:08 PM someniatko <somenia...@gmail.com> wrote:
> > 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. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > I agree with @someniatko, it makes PHP more consistent, which IMHO is always positive and one of the usually criticized points (lack of consistency throughout parameter order, naming convention etc).