On Fri, Nov 4, 2022 at 10:49 AM Marco Pivetta <ocram...@gmail.com> wrote:

> What's convenient about `Foo::{$bar}` vs `constant(Foo::class . '::' .
> $bar)`? I'm a bit confused by this :|

>From the static analysis POV `Foo::{$bar}` is way better, as we can immediately
see that the code is trying to access a constant of a specific class,
and we can,
e.g., flag those operations that did not validate that `$bar` actually exists
as a Foo constant.

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

Reply via email to