Page 1 of 1

PHP: How it works

Posted: Tue Jan 20, 2004 12:55 pm
by EricKatz
How does PHP work? I have been programming in PHP for some time, and I am interested in the lower-level details. Does anyone know of a site or a book that explains the inner workings of PHP in lots of detail?

Thanks,
Eric[/google]

Posted: Tue Jan 20, 2004 1:30 pm
by Stoker
if you want lots of detail you are probably stuck with the source, the comments within isnt allways that great.. Never heard of a book about the php source....

what are you interrested in? building or modifying an extension?

Posted: Wed Jan 21, 2004 10:52 am
by Meteo
it works like any other programming language,
programming languages need either compilers or translators to understand the programming. a compiler already has the code read, and the code is ready to be ran. most programs run on the computer have been compiled. a translator program reads through the lines while it parses the programming. php is a translation language, because it goes one line at a time while parsing in the browser.

when the browser sees a <?php, it sends all the information to the translator in between the <?php and ?> tags, and the translator translates it into html which is viewable by the web browser, it's that simple really.

Posted: Wed Jan 21, 2004 11:19 am
by Roja
Meteo wrote:it works like any other programming language,
programming languages need either compilers or translators to understand the programming. a compiler already has the code read, and the code is ready to be ran. most programs run on the computer have been compiled. a translator program reads through the lines while it parses the programming. php is a translation language, because it goes one line at a time while parsing in the browser.

when the browser sees a <?php, it sends all the information to the translator in between the <?php and ?> tags, and the translator translates it into html which is viewable by the web browser, it's that simple really.
That's actually somewhat inaccurate, and definitely over-simplified, and the original poster wanted low-level (NOT simplified) details about the inner workings of PHP.

A few fantastic resources to help the poster with his request:

- Zend and extending PHP - a great in-depth look at the C underpinnings of PHP and how to extend it

- Zend API - The full API for PHP and Zend to allow for extending PHP in new and novel ways

Posted: Wed Jan 21, 2004 11:32 am
by Stoker
Its quite a while since I looked for this stuff and I hadnt seen the derickrethans site before, that looks a very good way of finding some key pieces! :)