|
Posted by Jerry Stuckle on 07/21/07 14:50
Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> Unless you have implemented a PHP optimizer, every PHP file is
>> interpreted every time you load the file. There is no intermediate code.
>
> There normally *is* an intermediate form, but it's discarded after each
> execution unless you have a PHP cache, such as eAccelerator.
>
> That is, on each execution, the PHP interpreter:
>
> 1. Opens up the file;
> 2. Tokenises it, storing the token stream in memory;
> 3. Parses it into a form of byte code, storing that in
> memory too; then
> 4. Executes the byte code.
>
> Most smart interpreters (and I assume PHP is included here) will also
> perform a bit of code optimisation around stage 3 too. Code optimisation
> trades off execution time for parsing time, so interpreters (optimise once,
> run once) tend not to optimise as much as compilers (optimise once, run
> many) do.
>
If you want to go that far, you can say the same thing about documents
in your favorite text editor. After all, there is an "intermediate"
form of the file in memory.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|