I have spent an hour today debugging a weird issue: PHPUnit complained that it tried to call an undefined function PHPUnit\Framework\Assert\assertEquals(). Because right now I am working with custom PHP extensions, I suspected that my code somehow corrupted PHP’s internal data structures. But reality prepared me a surprise.
For the second time in a row, I find a bug in PHP. This time PHP segfaults due to memory corruption during the request shutdown phase.
When testing your own PHP extensions, it is very important not to miss any memory leaks. Wherever Valgrind shows a memory leak, you need to check your code for bugs. However, sometimes you can find a memory leak in the PHP Core.