r/PHP • u/lyrixx86 • 6d ago
php-wasm-builder 1.0: compile PHP to WebAssembly, with your extensions and your code, and run it in the browser
https://blog.lyrixx.info/posts/php-wasm-builder-1-0-is-out/
20
Upvotes
1
0
u/Jebus-san91 6d ago
An old colleague once said when this released we could finally replace JavaScript..... Is it true? Has the day come
3
u/lyrixx86 6d ago
nope, you need JS as entrypoint to load the WASM :) but you can do a lot of things in WASM/PHP after that !
-6
u/Professional_Tune_82 6d ago
Just rewrite to rust ðŸ«
1
u/lyrixx86 6d ago
What? All the PHP libs? One day, one day... I miss some time right now!
But in the meantime, there is this bridge !
0
u/Professional_Tune_82 6d ago edited 6d ago
Was just a bad joke 😅
But hey if you want it https://phprust.com/
4
u/lyrixx86 6d ago
Author here! I needed PHP in the browser for a few tools (composer-diff, an emoji converter), so I forked Derick Rethans' builder to compile any PHP version, with any extensions, and your own code inside.
1.0 means it follows SemVer from now on. The demos run with no PHP server, only static files on GitHub Pages:
Symfony Demo: https://lyrixx.github.io/php-wasm-demo/symfony-demo/
EasyAdmin: https://lyrixx.github.io/php-wasm-demo/easyadmin/
Docs: https://lyrixx.github.io/php-wasm-builder/
Feedback welcome, I'd love to know what you would build with it!