Was meant to link to this answer: https://www.quora.com/What-is-a-coders-worst-nightmare/answe...
I had something similar to this story happen to a PHP site on shared hosting in the early 2000s that at the time seemed like some kind of cursed magic it was obfuscated so well and reasserted itself every time I tried to edit it out. Luckily replacing all the source files solved it (though the breach itself was a deeper issue). I can't imagine if the problem had gone to the level of the PHP interpreter itself or even deeper how long it would have taken me to find it back then.