Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Lester Caine
On 04/12/2020 23:24, Larry Garfield wrote: The first step, for unit enumerations, is here: https://wiki.php.net/rfc/enumerations There's still a few bits we're sorting out and the implementation is mostly done, but not 100% complete. I use 'Enumerations' quite extensively but have not found th

Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Larry Garfield
On Wed, Dec 9, 2020, at 2:03 PM, Mike Schinkel wrote: > > Unless I'm missing something, trying to define "idempotence" or "pure > > functions" any more strictly than that would surely be a massive project in > > itself - for a start, you'd need a whitelist of all built-in operations > > which

Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Mike Schinkel
> On Dec 9, 2020, at 3:29 PM, Benjamin Morel wrote: > > On Wed, 9 Dec 2020 at 19:48, Mike Schinkel > wrote: > > 5. Someone else mentioned shortcut syntax, which I would like to mention > again, although I realize implement details might make this a non-starter. >

Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Benjamin Morel
On Wed, 9 Dec 2020 at 19:48, Mike Schinkel wrote: 5. Someone else mentioned shortcut syntax, which I would like to mention > again, although I realize implement details might make this a non-starter. > > So if I have a function that accepts a Size from above, e.g.: > > function show(Size $size) {

Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Mike Schinkel
> On Dec 9, 2020, at 2:06 PM, Rowan Tommins wrote: > > On 09/12/2020 18:47, Mike Schinkel wrote: >> 1. Will enum methods be idempotent? >> >> If not, shouldn't they be? > > > Can you clarify what you mean here? For a given parameter set the method would always return the same value. Note I a

Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Rowan Tommins
On 09/12/2020 18:47, Mike Schinkel wrote: 1. Will enum methods be idempotent? If not, shouldn't they be? Can you clarify what you mean here? The only meaningful question I can think of is "can they change the object's state?" That's mostly answered in the RFC, most notably by specifying tha

Re: [PHP-DEV] [RFC] Enumerations

2020-12-09 Thread Mike Schinkel
> On Dec 4, 2020, at 6:24 PM, Larry Garfield wrote: > > Greetings, denizens of Internals! > > Ilija Tovilo and I have been working for the last few months on adding > support for enumerations and algebraic data types to PHP. This is a > not-small task, so we've broken it up into several stage

Re: [PHP-DEV] PHP 8 is_file/is_dir input handling

2020-12-09 Thread Mike Schinkel
> On Dec 8, 2020, at 11:27 AM, Christian Schneider > wrote: > > Am 08.12.2020 um 17:16 schrieb Mike Schinkel >: >> 1. Please consider making is_file() return false for an embedded \0 and no >> longer throw an exception or generate a warning. > > The PR implementi