Re: [PHP-DEV] [RFC] Pure intersection types

2021-06-02 Thread G. P. B.
On Mon, 31 May 2021 at 16:09, G. P. B. wrote: > Hello, > > It has been two weeks since my last email and the only thing which has > come up are the tokenizer changes pointed out by Tyson. > To preserve BC I've aliased T_AMPERSAND with > T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG > This is also reflect

Re: [PHP-DEV] [RFC] Pure intersection types

2021-05-31 Thread G. P. B.
Hello, It has been two weeks since my last email and the only thing which has come up are the tokenizer changes pointed out by Tyson. To preserve BC I've aliased T_AMPERSAND with T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG This is also reflected in the RFC: https://wiki.php.net/rfc/pure-intersection-typ

Re: [PHP-DEV] [RFC] Pure intersection types

2021-05-17 Thread G. P. B.
On Mon, 17 May 2021 at 15:17, Larry Garfield wrote: > On the reflection front, am I correct that we'd end up with: > > abstract ReflectionType > -- ReflectionNamedType (single type) > -- ReflectionUnionType (basically an array of named types) > -- ReflectionIntersectionType (basically an array of

Re: [PHP-DEV] [RFC] Pure intersection types

2021-05-17 Thread Larry Garfield
On Mon, May 17, 2021, at 3:58 AM, G. P. B. wrote: > Hello internals, > > As we are getting closer to feature freeze I want to move this proposal > forward. > The RFC is now also on the wiki: > https://wiki.php.net/rfc/pure-intersection-types > > Composite types are left out of scope as it seems t

Re: [PHP-DEV] [RFC] Pure intersection types

2021-05-17 Thread G. P. B.
Hello internals, As we are getting closer to feature freeze I want to move this proposal forward. The RFC is now also on the wiki: https://wiki.php.net/rfc/pure-intersection-types Composite types are left out of scope as it seems they should be handled with grouping (e.g. (A&B) | C ) and not rely

Re: [PHP-DEV] [RFC] Pure intersection types

2021-04-03 Thread Saif Eddin Gmati
Personally, I am against the syntax used in the PR for composite types( even tho i don't have voting powers ). I would prefer a syntax similar to Hack, where you have to use parentheses to make things more explicit. considering the following Hack code: interface A {} interface B {}

Re: [PHP-DEV] [RFC] Pure intersection types

2021-04-03 Thread G. P. B.
On Tue, 23 Mar 2021 at 19:45, Matthew Brown wrote: > On Tue, 23 Mar 2021 at 05:32, G. P. B. wrote: > >> I'm calling this proposal pure intersection types as there would be no >> possibility of mixing intersection and union types, I'm leaving this as a >> future scope. >> > > Does this miss an op

Re: [PHP-DEV] [RFC] Pure intersection types

2021-03-23 Thread Matthew Brown
On Tue, 23 Mar 2021 at 05:32, G. P. B. wrote: > I'm calling this proposal pure intersection types as there would be no > possibility of mixing intersection and union types, I'm leaving this as a > future scope. > Does this miss an opportunity, though? It's useful to be able to write A&B|null.

Re: [PHP-DEV] [RFC] Pure intersection types

2021-03-23 Thread G. P. B.
On Tue, 23 Mar 2021 at 13:14, Larry Garfield wrote: > On Tue, Mar 23, 2021, at 4:32 AM, G. P. B. wrote: > > Greetings internals, > > > > I'm presenting a new RFC to add support for pure intersection types to > PHP. > > > > An intersection type A&B means that the value must be of type A and of > t

Re: [PHP-DEV] [RFC] Pure intersection types

2021-03-23 Thread someniatko
> Should we be planning ahead for some future where union and intersection > types can be mixed and design the reflection API accordingly? I worry that > if we have a ReflectionIntersectionType, and a ReflectionUnionType, that > ReflectionIntersectionAndUnionType is just going to make both impl

Re: [PHP-DEV] [RFC] Pure intersection types

2021-03-23 Thread Larry Garfield
On Tue, Mar 23, 2021, at 4:32 AM, G. P. B. wrote: > Greetings internals, > > I'm presenting a new RFC to add support for pure intersection types to PHP. > > An intersection type A&B means that the value must be of type A and of type > B at the same time. > > I'm calling this proposal pure inters

Re: [PHP-DEV] [RFC] Pure intersection types

2021-03-23 Thread Marco Pivetta
Hey George, On Tue, Mar 23, 2021 at 10:32 AM G. P. B. wrote: > Greetings internals, > > I'm presenting a new RFC to add support for pure intersection types to PHP. > > An intersection type A&B means that the value must be of type A and of type > B at the same time. >

[PHP-DEV] [RFC] Pure intersection types

2021-03-23 Thread G. P. B.
Greetings internals, I'm presenting a new RFC to add support for pure intersection types to PHP. An intersection type A&B means that the value must be of type A and of type B at the same time. I'm calling this proposal pure intersection types as there would be no possibility of mixing intersecti