Is there some guide out there that describes how the PHP internals?
Sounds to me like you're you should look for resources on PHP Internal development. Looking for this information elsewhere will be really scattered.
I suggest picking up a PHP Core development book from your local book store and giving it a read. PHP.net has an underdeveloped beginners reference if you wanted to start there.