Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Ilija Tovilo
On Thu, Feb 6, 2025 at 10:43 PM Christoph M. Becker wrote: > > On 06.02.2025 at 20:24, Larry Garfield wrote: > > > On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > > > >> Are there any plans to upgrade the parser to bypass these limitations? > >> I remember Nikita shared some thoughts o

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Christoph M. Becker
On 06.02.2025 at 20:24, Larry Garfield wrote: > On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > >>> Because PHP uses only an LL(1) parser Actually, we're using an LALR(1) parser; LL(1) is more constrained (although, personally, I like those for their simplicity). >> Are there any pla

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Larry Garfield
On Thu, Feb 6, 2025, at 3:05 AM, Valentin Udaltsov wrote: > Hi, Larry! > > First of all, I'm very excited about your Pattern Matching RFC and > looking forward to it. > >> Because PHP uses only an LL(1) parser > > Are there any plans to upgrade the parser to bypass these limitations? > I remembe

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Morgan
On 2025-02-04 17:31, Larry Garfield wrote: However, there is a concern that it wouldn't be self-evident to PHP devs, and the variable binding side should have the extra marker. Ilija has suggested &, as that's what's used for references, which would result in: $b = '12'; if ($arr is ['a' =

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Valentin Udaltsov
On Tue, 4 Feb 2025 at 07:35, Larry Garfield wrote: > Hi folks. Ilija is still working on the implementation for the pattern > matching RFC, which we want to complete before proposing it officially in > case we run into implementation challenges. > > Such as these, on which we'd like feedback on

Re: [PHP-DEV] Pattern matching details questions

2025-02-05 Thread Larry Garfield
On Tue, Feb 4, 2025, at 4:30 PM, Rob Landers wrote: > On Tue, Feb 4, 2025, at 22:16, Larry Garfield wrote: >> Patterns are deliberately designed as a superset of existing DNF types. You >> can already have a type of Foo&Bar, so we want the pattern for "instanceof >> Foo || instanceof Bar" to be

Re: [PHP-DEV] Pattern matching details questions

2025-02-04 Thread Rob Landers
On Tue, Feb 4, 2025, at 22:16, Larry Garfield wrote: > On Tue, Feb 4, 2025, at 1:14 PM, Marc Bennewitz wrote: > > On 04.02.25 08:51, Rob Landers wrote: > >> > >> > >> On Tue, Feb 4, 2025, at 05:31, Larry Garfield wrote: > >>> Hi folks. Ilija is still working on the implementation for the patte

Re: [PHP-DEV] Pattern matching details questions

2025-02-04 Thread Larry Garfield
On Tue, Feb 4, 2025, at 3:16 PM, Larry Garfield wrote: > Patterns are deliberately designed as a superset of existing DNF types. > You can already have a type of Foo&Bar, so we want the pattern for > "instanceof Foo || instanceof Bar" to be the same. That means & and | > for conjunctions is n

Re: [PHP-DEV] Pattern matching details questions

2025-02-04 Thread Larry Garfield
On Tue, Feb 4, 2025, at 1:14 PM, Marc Bennewitz wrote: > On 04.02.25 08:51, Rob Landers wrote: >> >> >> On Tue, Feb 4, 2025, at 05:31, Larry Garfield wrote: >>> Hi folks. Ilija is still working on the implementation for the pattern >>> matching RFC, which we want to complete before proposing it

Re: [PHP-DEV] Pattern matching details questions

2025-02-04 Thread Marc Bennewitz
On 04.02.25 08:51, Rob Landers wrote: On Tue, Feb 4, 2025, at 05:31, Larry Garfield wrote: Hi folks.  Ilija is still working on the implementation for the pattern matching RFC, which we want to complete before proposing it officially in case we run into implementation challenges. Such as t

Re: [PHP-DEV] Pattern matching details questions

2025-02-03 Thread Rob Landers
On Tue, Feb 4, 2025, at 05:31, Larry Garfield wrote: > Hi folks. Ilija is still working on the implementation for the pattern > matching RFC, which we want to complete before proposing it officially in > case we run into implementation challenges. > > Such as these, on which we'd like feedbac