Re: [PHP-DEV] RFC: Support for multi-line arrow functions

2020-10-04 Thread Mike Schinkel
> On Oct 4, 2020, at 4:08 PM, Rowan Tommins wrote: > > Hi Nuno, > > On 03/10/2020 22:09, Nuno Maduro wrote: >> A few days ago I opened a pull request that adds support for multi-line >> arrow functions in PHP: https://github.com/php/php-src/pull/6246. > > > Welcome to the list. Firstly, it's p

Re: [PHP-DEV] Literal types RFC

2020-10-04 Thread Bogdan Ungureanu
Yeah, kind of, the problem with enums from what I understood from the current RFCs is that you'll need extra code to map a scalar to that specific enum value. Besides that, a literal type implementation is afaik simpler to implement/spec than enums, thus having a better chance to pass voting. On

Re: [PHP-DEV] Literal types RFC

2020-10-04 Thread Max Semenik
пн, 5 окт. 2020 г., 02:38 Bogdan Ungureanu : > > function getStatus(): "draft" | "published" { } > It sounds that what you're really asking for is enums, e.g. enum Status { Draft, Published }; function getStatus(): Status { ... } >

[PHP-DEV] Literal types RFC

2020-10-04 Thread Bogdan Ungureanu
Hello internals, Since union types have landed in PHP, this allows us the possibility to have literal types support as well and I would like to hear your thoughts about an RFC for it. I think a feature like this would greatly improve the way we model our code in very common use cases. For example

Re: [PHP-DEV] RFC: Support for multi-line arrow functions

2020-10-04 Thread Rowan Tommins
Hi Nuno, On 03/10/2020 22:09, Nuno Maduro wrote: A few days ago I opened a pull request that adds support for multi-line arrow functions in PHP: https://github.com/php/php-src/pull/6246. Welcome to the list. Firstly, it's probably worth having a look in the mailing list archives for prior di