Adding on to jart's answer -- I ported PHP 7.3 back in July 2021 (building on alganet's work), and got up to a simple "hello-world". Have never used PHP, so I didn't know what else could be done with it at the time.
However, the libc has grown a lot over the last year (Cosmo has a pthreads API now!) -- the updated libc enabled a quick experimental port of Python 3.11.0rc1 back in August (https://github.com/ahgamut/cpython/tree/cosmo_py311), so I would expect that a newer version of PHP can be ported similarly. Let's see....
Adding on to jart's answer -- I ported PHP 7.3 back in July 2021 (building on alganet's work), and got up to a simple "hello-world". Have never used PHP, so I didn't know what else could be done with it at the time.
However, the libc has grown a lot over the last year (Cosmo has a pthreads API now!) -- the updated libc enabled a quick experimental port of Python 3.11.0rc1 back in August (https://github.com/ahgamut/cpython/tree/cosmo_py311), so I would expect that a newer version of PHP can be ported similarly. Let's see....
ah, here we are: https://github.com/ahgamut/php-src/tree/cosmo_php81
(note it's an experimental port, I just put it together).
We managed to get it to build I think last year. https://github.com/ahgamut/php-src/tree/cosmo_php73 See also https://github.com/shmup/awesome-cosmopolitan
Yeah, I’ve wanted this for a long time. I’m going to try but can’t promise anything.
Same but for Python. I'll probably look into it when I'm sufficiently bored with my current projects.
5 months ago on HN, "Python is Actually Portable", https://news.ycombinator.com/item?id=32245430 (120 comments)
To quote the blogpost: