On 5 January 2024 12:18:51 GMT, Robert Landers <landers.rob...@gmail.com> wrote:
>This is easy to handle from C. If the callback takes an argument,
>don't fill in the super-globals.

Again, that's compatible only in a narrow sense: it provides both APIs on any 
run-time which can do so safely.

You still have an incompatible upgrade to make though: if you write code today 
for FrankenPHP, and directly use the super-global arrays it populates, you 
cannot take that code tomorrow and use it in Swoole, which does not provide 
those super-globals.

If you write code today which uses callback parameters, you can take that code 
and use it unmodified with any system which provides those parameters - 
including async implementations. All that's missing for that to happen right 
now is a standard format for those parameters.


> It allows legacy apps to be slowly
>"upgraded" while allowing newer apps to take full advantage of a SAPI.

It's actually quite easy to add most of the backwards compatibility needed for 
legacy apps in userland, by populating the superglobals, and running an output 
buffer to capture echo etc into the response.


> However, if we go into the design with the
>concurrent server story in mind, I think we can create something much
>better than what is available from FrankenPHP.

Precisely. That's why I used the phrase "forwards compatibility" - I'm not 
saying php-src needs to support all of this right now, just that *the API 
design* should have an eye on the future, not just the past.

Regards,

-- 
Rowan Tommins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to