I’d like to push back on the idea that this bug would have been quite difficult for a human to discover. I’m not much of a C programmer these days, but I’ve known longjmp to be a code smell for decades now. The reasons why were broadly covered in a 1968 CACM letter to the editor by Dijkstra that we’ve all certainly heard about. Though possibly not everyone makes the connection because if all you know of the article is its title then you can perhaps be forgiven for thinking it was only talking about one language keyword in particular.
What I’m getting at is that this PHP bug was adorned with marquee lights and sirens and a giant sign saying, “Hey, look here!”
That said, when that code was written 20 years ago they could perhaps be forgiven for this approach to handling OOM. The alternatives apparently come with a pretty decent performance penalty, and culture around memory safety wasn’t as strong then as it is now. But in 2026 there is an argument to be made that exploits are so common and damage potential is so high that we need to take the same mindset that flight control software developers have in their coding standards: some ways of doing things are dangerous enough that simply using them is a defect, even when they work exactly as intended, because they are just too hard to reason about.