Hi!
Just do a search in the source code for PHP (get the UNIX version, not the Windows one) and edit the functions' code. It is in C, however bear in mind that you will have to learn Zend API which is a layer over regular C with different built-in types, constructs, etc.
Best regards,
Stas