Re: Should there be a `get_declared_enums()` function ?

From: Date: Fri, 16 Aug 2024 15:50:13 +0000
Subject: Re: Should there be a `get_declared_enums()` function ?
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-124983@lists.php.net to get a copy of this message
On Fri, 16 Aug 2024, 16:46 Christoph M. Becker, <cmbecker69@gmx.de> wrote: > On 16.08.2024 at 17:11, Nicolas > > > > And here is a one liner: > > > > function get_declared_enums() { > > return array_filter(get_declared_classes(), 'enum_exists'); > > } > > Nice! > > Are you suggesting that there is no need for get_declared_enums() in the > core, since it can be implemented in userland with a single function call? > I think he just compulsively golfs inefficient PHP code (I have the same affliction). Cheers, Bilge >

« previous php.internals (#124983) next »