Re: [PHP-DEV] [RFC][Discussion] Objects can be declared falsifiable

2022-11-04 Thread Josh Bruce
> While I understand the proposed feature is opt-int it introduces more magic > that can be solved using more verbose and IMO cleaner solutions. Understood and appreciate the position. > This is somehow confusing, why is the $response storing object ref is ok > while inclining the new object crea

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 l

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 addi

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 al

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 need

Re: [PHP-DEV] ARRAY_UNIQUE_IDENTICAL option

2022-11-04 Thread Christoph M. Becker
On 04.11.2022 at 10:05, Rowan Tommins wrote: > On 3 November 2022 18:53:40 GMT, someniatko wrote: > >> You will have to memorize yet another PHP quirk, or be able to build a >> logical chain: >> - enums are non-comparable by default >> - enums have no default string value (if not baked by a strin

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. We

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. Th

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 me

Re: [PHP-DEV] ARRAY_UNIQUE_IDENTICAL option

2022-11-04 Thread Rowan Tommins
On 3 November 2022 18:53:40 GMT, someniatko wrote: >You will have to memorize yet another PHP quirk, or be able to build a >logical chain: >- enums are non-comparable by default >- enums have no default string value (if not baked by a string) >- array_unique internally sorts an array >- default fl