RE: [PHP] PHP Source code protection
| From: | Richard Lynch | Date: | Thu, 14 Feb 2008 23:13:06 +0000 |
| Subject: | RE: [PHP] PHP Source code protection | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269341@lists.php.net to get a copy of this message | ||
On Thu, February 7, 2008 8:35 pm, Andrés Robinet wrote:
> 1 - I believe the fact that we don't "encode" (read "compile") our
> scripts is
> tightly related to the fact that we don't have a bytecode interpreter
> (say JIT
> compiler or something?) bundled into PHP.
Errrrr.
PHP has a bytecode interpreter in the Zend Engine...
That's kinda what it *does*
It's not a JIT, however, at this time, though there's always talk on
internals@ about making it more and more JIT-like.
The various caching mechanisms (Zend Cache Accelerator, APC, etc) all
store the bytecode version of the PHP script, not the original source.
This provides a TINY performance benefit, which is completely dwarfed
by not hitting the hard disk to read the PHP script, and costs almost
nothing since it's basically the difference between this psuedo C
code:
.
.
.
script = fread(fp, 1000000000);
cache(script);
bytecode = parse(script);
.
.
.
and this:
.
.
.
script = fread(fp, 1000000000);
bytecode = parse(script);
cache(bytecode);
.
.
.
You can rely on the bytecode interpreter being there, as that's what
the Zend Engine *is*.
This does not necessarily make your other points invalid -- but they
cannot be based around the [incorrect] facts you stated. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?