tags:

views:

118

answers:

4

I was wondering if there's a decent resource for finding the inner workings of PHP.

I have taken a look at the source, but a decent explanation would really help.

Some example questions I'd like answered.

How does a PHP script get interpreted into machine readable code?

How does it interact with Apache, how does apache collect the HTML response from PHP?

And other questions like that.

+3  A: 

It may be a bit outdated but I think you'll find this useful:

PHP internals and the Zend API

lamas
A: 

The PHP website is http://php.net/. It has a lot of information.

Arlen Beiler
+1  A: 

Have you taken a look at this thread on Reddit:

IAm finishing my PhD in compilers. I wrote a PHP compiler. AMA

http://www.reddit.com/r/IAmA/comments/9rpa3/for_my_fellow_geeks_iam_finishing_my_phd_in/

including the related Google Tech Talk.

Jack
I can't see because Reddit is blocked from where I am currently, but if I recall that discussion is about something a bit different - he wrote a compiler that compiles PHP to native executables, rather than to bytecode as the standard PHP compiler does.
Alex JL
It looks like you're correct from reading the site:http://phpcompiler.org/However from being a reddit junkie it appears that Facebook will be open sourcing their runtime rewrite, so perhaps there will be useful documentation that comes out of that:http://www.reddit.com/r/programming/comments/aw7ni/facebook_rewrites_php_runtime_will_open_source_on/
Jack
A: 

The best book on te topic is Sara Golemon's Extending and Embedding PHP.

It uses PHP 5.1.0, but everything should be appliable to any 5.x. You can find information about changes to 5.3 (especially for namespaces) in the source code.

Flavius