Author here. Faster than it has ever been in the Edge via WebAssembly :)
But you are completely right pointing out that there's still some room to improve, specially when compared to running PHP natively.
Right now there's some price to pay for the isolation and sandboxing, but we are working hard to reduce the gap to zero. Stay tuned for more updates on this front!
Given that we run PHP on the edge, what is the point of running the PHP interpreter on top of a WebAssembly interpreter (Wasmer) instead of just running the PHP interpreter directly?
From what I can tell it's because some of these "edge" service providers will expect you to give them a WASM binary instead of a PHP script.
The other caveats about "edge" throughout this discussion aside, if I needed to do this, I'd try to write something in Zig or (gag) JS or something else that compiles to WASM directly rather than writing a script for an interpreter that runs under WASM.
Nb PHP is already really fast. Some major things built on it are slow, mostly due to things like poor data access patterns or architecture, but its culture since the beginning has basically been “get out of PHP and into C as fast as possible” and it shows (this is basically the trick to any scripting language “being fast”, PHP just embraced it hard from the very beginning).
If you’re on PHP and need more speed in the language itself, basically every other scripting language (yes, including Node) is off the table immediately. Lateral move at best.
(All that to say, yeah, I entirely expected that the headline would lead to an article about making PHP slower)
> PHP just embraced it hard from the very beginning
Which is also the reason why a lot of the PHP standard library functions are so inconsistent. They're straight wrappers around the C libraries.
Upside is, unless you have to do shit with pointer magic or play around the edges of signed/unsigned numbers, it's fairly easy to port C example code for any of the myriad things PHP has bindings to to PHP.