phpinterpreted-language

php as interpreter language or compiled


Possible Duplicate:
Is PHP compiled or interpreted?

I am little confused with the words used with PHP. I know PHP is a scripting language. Some times I read it is interpreted or some time it is compiled!

How?, Is it something to do with when it is installed as Apache module it is compiled and if it is installed as CGI then it will be interpreted... But I know someone use to tell me that PHP is interpreted language too...

I may sound stupid but Currently, I am quite confused .I am quite aware of difference between compiler and interpreter.


Solution

  • Typically, PHP is an interpreted language. The script is read and evaluated at run-time by the interpreter. It is not pre-compiled into a different form.

    There are PHP compilers, some which actually compile them, and some which just package/obfuscate the script along with the interpreter into a self-standing executable.

    Related question about Zend Engine (actual compiler): How zend engine compile php codes or How php compiler works?

    Related product, open source PHP compiler (makes an executable, obfuscates php, includes interpreter): http://www.phpcompiler.org/