Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-06 Thread Mike Schinkel
> On Oct 6, 2024, at 3:25 AM, Juliette Reinders Folmer > wrote: > > On 4-10-2024 13:44, Nicolas Grekas wrote: > > Hi Nicolas, >> # Introduction of the new function: get_declared_enums() >> >> About this proposal, I shared a one-liner in the previous thread that shows >> listing only enums is

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-06 Thread Larry Garfield
On Sun, Oct 6, 2024, at 2:25 AM, Juliette Reinders Folmer wrote: > I can imagine combining the alternative approach via > get_declared_symbols() with a new symbol_exists() function like you > suggest above (with a similar slow path to deprecate and remove the old > functions). > > On the plus s

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-06 Thread Juliette Reinders Folmer
On 4-10-2024 13:44, Nicolas Grekas wrote: Hi Nicolas, # Introduction of the new function: get_declared_enums() About this proposal, I shared a one-liner in the previous thread that shows listing only enums is trivial already. IMHO we don't need this function since the engine already provides

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-04 Thread Tim Düsterhus
Hi Am 2024-10-04 13:44, schrieb Nicolas Grekas: # Introduction of the new function: get_declared_enums() About this proposal, I shared a one-liner in the previous thread that shows listing only enums is trivial already. IMHO we don't need this function since the engine already provides everyt

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-04 Thread Tim Düsterhus
Hi Am 2024-10-03 14:01, schrieb Gina P. Banyard: As a counterpoint to the argument presented on the list that Enums should still be returned by get_declared_list() because they are "classes": Interfaces and traits are also "classes" internally, and yet they are not returned. We make a distinct

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-04 Thread Nicolas Grekas
Hi Juliette, L.S., > > After the earlier discussion [1] regarding this topic in August, it is our > pleasure to present the RFC to add a `get_declared_enums()` function to PHP > for discussion. > > https://wiki.php.net/rfc/get_declared_enums > > We look forward to your feedback and hope for a cons

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-04 Thread Derick Rethans
On Wed, 2 Oct 2024, Juliette Reinders Folmer wrote: > L.S., > > After the earlier discussion [1] regarding this topic in August, it is our > pleasure to present the RFC to add a `get_declared_enums()` function to PHP > for discussion. > > https://wiki.php.net/rfc/get_declared_enums > > We look

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-03 Thread Gina P. Banyard
On Tuesday, 1 October 2024 at 23:45, Juliette Reinders Folmer wrote: > L.S., > > After the earlier discussion [1] regarding this topic in August, it is our > pleasure to present the RFC to add a `get_declared_enums()` function to PHP > for discussion. > > https://wiki.php.net/rfc/get_declared_

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Rob Landers
On Wed, Oct 2, 2024, at 14:27, Alexandru Pătrănescu wrote: > > On Wed, Oct 2, 2024 at 11:06 AM Rob Landers wrote: >> __ >> On Wed, Oct 2, 2024, at 09:20, Alexandru Pătrănescu wrote: >>> >>> On Wed, Oct 2, 2024 at 1:48 AM Juliette Reinders Folmer >>> wrote: L.S., After the earli

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Alexandru Pătrănescu
On Wed, Oct 2, 2024, 21:32 Larry Garfield wrote: > On Wed, Oct 2, 2024, at 7:27 AM, Alexandru Pătrănescu wrote: > > > If we remove the limitations, should we reclassify at that point enums > > as classes? > > Enums already are classes. I don't know what reclassification you're > talking about.

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Larry Garfield
On Wed, Oct 2, 2024, at 7:27 AM, Alexandru Pătrănescu wrote: > I think my view comes from when I initially dug (15+ years ago) into > what an enum in Java is, and learned that it is just a syntactic sugar, > and a final class would be generated implementing `Comparable` and > extending an abstr

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Alexandru Pătrănescu
On Wed, Oct 2, 2024 at 11:06 AM Rob Landers wrote: > On Wed, Oct 2, 2024, at 09:20, Alexandru Pătrănescu wrote: > > > On Wed, Oct 2, 2024 at 1:48 AM Juliette Reinders Folmer < > php-internals_nos...@adviesenzo.nl> wrote: > > L.S., > > After the earlier discussion [1] regarding this topic in Augus

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Derick Rethans
On 2 October 2024 09:06:20 BST, Rob Landers wrote: >You cannot build a “class” with these rules in PHP, so I don’t think enums >quack sufficiently like classes to be called a class. I would argue that it is >an object, however. I think it would be worth implementing a >get_declared_objects() t

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Alexandru Pătrănescu
On Wed, Oct 2, 2024 at 10:20 AM Alexandru Pătrănescu wrote: > > One would be able to get only the enums by using something like: > ```php > function get_declared_enums_only() { > return array_diff(get_declared_classes(), get_declared_enums()); > } > ``` > > Sorry, I somehow got confused, and

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Rob Landers
On Wed, Oct 2, 2024, at 09:20, Alexandru Pătrănescu wrote: > > On Wed, Oct 2, 2024 at 1:48 AM Juliette Reinders Folmer > wrote: >> L.S., >> >> After the earlier discussion [1] regarding this topic in August, it is our >> pleasure to present the RFC to add a `get_declared_enums()` function to P

Re: [PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-02 Thread Alexandru Pătrănescu
On Wed, Oct 2, 2024 at 1:48 AM Juliette Reinders Folmer < php-internals_nos...@adviesenzo.nl> wrote: > L.S., > > After the earlier discussion [1] regarding this topic in August, it is our > pleasure to present the RFC to add a `get_declared_enums()` function to PHP > for discussion. > > https://wi

[PHP-DEV] [RFC] [Discussion] Add get_declared_enums() function

2024-10-01 Thread Juliette Reinders Folmer
L.S., After the earlier discussion [1] regarding this topic in August, it is our pleasure to present the RFC to add a `get_declared_enums()` function to PHP for discussion. https://wiki.php.net/rfc/get_declared_enums We look forward to your feedback and hope for a constructive discussion. S