As long as PHP is written in C, it will be insecure.
It sounds cliche but yes, they should rewrite PHP in rust or other memory safe language.
And, i don't understand why we are still using PHP. Agents can use Rust or go directly and we get benefit of performance...
As long as programmers trust 3rd-party-provided content-length input, it will be insecure. At this point, I'm not sure why we even use content-length anymore since you're going to need to size your buffers based on the actual content.