Is there a way to compile a D object file with some C code? I am looking
into creating a PHP extension from D instead of C and as I see it, I
would need to be able to create and interface function in C that can
call a D function.

You might be able to learn something from looking at PyD.
http://pyd.dsource.org/
That aims to let you write Python extensions in D.
It works by making shared libs though. That might be the best way. I
think that means you would have to use GDC on linux.
--bb