Search code examples
phpcompilation

Does PHP compile data?


I'm a student learning PHP. I basically make the stuff work, but never wondered about how the php.exe(on windows) works.

Does it compile the stuff it has to handle or not?

Reason I'm asking is because someone told me that ASP.NET has to compile all website-dependant data is has/receives, like everything that gets uploaded through a form. He claimed that PHP is faster on that subject, since it does not have to compile anything.

I can't find any good information on either subjects, so I'm asking here.


Solution

  • PHP is a scripting language, and so is not compiled as such. It is parsed into an interal representation which is in turn "run" by the PHP runtime.

    Your friend is correct in so far as that ASP.NET is compiled. However, it's only the actual program instructions that are compiled, not data. The way PHP and ASP.NET treat incoming (and outgoing) data are pretty similar in principle. If anything, ASP.NET will be faster than PHP because it is compiled, since compiled code generally runs faster.