Hello!

>> I'm more partial to Edmond Dantes's suggestion of providing parser hooks
https://github.com/true-async/php-src/compare/master...dsl-hooks

Your wish has been granted. 🙂

Here's an article explaining how it works. I didn't spend much time
thinking about the syntax—I simply borrowed it from JavaScript. 🙂
A huge thanks to Kirill for answering countless questions on this topic and
showing me the different approaches PHP has historically used to solve
problems like this.

https://x.com/Edmondif143061/status/2077842921827512720

The performance is expected to be excellent, especially if the parser is
implemented in C.

The generated code is compiled and cached immediately. There is no longer
any need to rely on backdoor techniques to implement features like this.

PHP could easily gain its own LINQ. This would also speed up SQL-like code,
since it would no longer need to be constructed at runtime. Doctrine, for
example, would no longer need to implement complex caching mechanisms to
compensate for that.

If there's anything I can do to help with the RFC, I'd be happy to
contribute.

чт, 16 июл. 2026 г. в 22:51, Morgan <[email protected]>:

> On 2026-07-15 11:36, Liam Hammett wrote:
> >
> > It proposes a native syntax for HTML fragments as first-class PHP
> expressions,
> > akin to how the frontend community has adopted JSX, with composition and
> > escape-by-default output:
> >
> Heh, just today by coincidence I was pointed toward https://jsx.lol/ -
> which, despite the name is more about React in general.
>
> I'm more partial to Edmond Dantes's suggestion of providing parser hooks
> so that different markup expression syntaxes can be added via extension,
> rather than locking in one that happened to be popular at one time.
>

Reply via email to