Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-17 Thread Ilija Tovilo
Hi everyone Sorry for the late reply. I won't waste too many lines on usefulness as it is highly subjective. The change will seem worth it to some people and not to others. IMO language consistency is important and mainly what I'm striving for. --- Hi Michał > Can it be extended to non class

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-06 Thread Nikita Popov
On Fri, Nov 4, 2022 at 3:26 PM Ilija Tovilo wrote: > Hi everyone > > I'd like to propose a simple RFC to introduce looking up class > constants by name. We have dedicated syntax for basically all other > language constructs. This RFC aims to get rid of this seemingly > arbitrary limitation. > >

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Bruce Weirdan
On Fri, Nov 4, 2022 at 10:49 AM Marco Pivetta 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

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Michał Marcin Brzuchalski
Hi Ilija, pt., 4 lis 2022, 15:26 użytkownik Ilija Tovilo napisał: > Hi everyone > > I'd like to propose a simple RFC to introduce looking up class > constants by name. We have dedicated syntax for basically all other > language constructs. This RFC aims to get rid of this seemingly > arbitrary

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Flávio Heleno
On Fri, Nov 4, 2022 at 12:08 PM someniatko 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

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread someniatko
> 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

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Larry Garfield
On Fri, Nov 4, 2022, at 9:45 AM, Ralf Lang wrote: > Hi Ilija, > > Am 04.11.2022 um 15:25 schrieb Ilija Tovilo: >> Please let me know if you have any thoughts. >> >> Ilija > > That new way of accessing class constants dynamically does not really > make things more readable for me. Maybe I just

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Marco Pivetta
On Fri, 4 Nov 2022 at 15:40, Larry Garfield wrote: > On Fri, Nov 4, 2022, at 9:31 AM, Marco Pivetta wrote: > > Heyo, > > > > On Fri, 4 Nov 2022 at 15:26, Ilija Tovilo > wrote: > > > >> Hi everyone > >> > >> I'd like to propose a simple RFC to introduce looking up class > >> constants by name.

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Ralf Lang
Hi Ilija, Am 04.11.2022 um 15:25 schrieb Ilija Tovilo: Please let me know if you have any thoughts. Ilija That new way of accessing class constants dynamically does not really make things more readable for me. Maybe I just need to get used to it, but especially that last example would make

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Larry Garfield
On Fri, Nov 4, 2022, at 9:31 AM, Marco Pivetta wrote: > Heyo, > > On Fri, 4 Nov 2022 at 15:26, Ilija Tovilo wrote: > >> Hi everyone >> >> I'd like to propose a simple RFC to introduce looking up class >> constants by name. We have dedicated syntax for basically all other >> language constructs.

Re: [PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Marco Pivetta
Heyo, On Fri, 4 Nov 2022 at 15:26, Ilija Tovilo wrote: > Hi everyone > > I'd like to propose a simple RFC to introduce looking up class > constants by name. We have dedicated syntax for basically all other > language constructs. This RFC aims to get rid of this seemingly > arbitrary limitation.

[PHP-DEV] [RFC][Dynamic class constant fetch]

2022-11-04 Thread Ilija Tovilo
Hi everyone I'd like to propose a simple RFC to introduce looking up class constants by name. We have dedicated syntax for basically all other language constructs. This RFC aims to get rid of this seemingly arbitrary limitation. https://wiki.php.net/rfc/dynamic_class_constant_fetch Please let