PHP handles running out of memory by raising a fatal error and jumping out of the current code path with longjmp(). Anything that was half-built at that moment stays half-built.
If request memory had been allocated but not yet initialised, request shutdown later reads or branches on that invalid data. Several multipart (file-upload form) parsing paths can drive PHP into out-of-memory within normal limits, which is why no application code needs to be involved.
Weaknesses listed by PHP: use-after-free (CWE-416), improper handling of exceptional conditions (CWE-755), access of uninitialised pointer (CWE-824) and related state-handling CWEs.