PHP itself is a memory safe language, this is a bug in the language implementation and VM. Which happens in other memory safe languages like Java or C#. This is sort of the equivalent of a Rust compiler bug that allows unsafe behavior to slip through, which also exist.