Page 1 of 1

PHP byte code?

Posted: Sun Oct 05, 2008 4:46 pm
by alex.barylski
How low level is this code? Does the byte code break classes into functions and expand member variables into globals, etc?

I would think an interpreter would be easier to implement working on lower level byte code as opposed to working on higher level abstractions like classes, etc???

Anyone have any idea? Any resources?

Re: PHP byte code?

Posted: Mon Oct 06, 2008 12:35 pm
by Weirdan
http://pecl.php.net/package/vld would be your best resource.

Re: PHP byte code?

Posted: Mon Oct 06, 2008 11:46 pm
by alex.barylski
Thanks. I read that already.

I read several other resources on the topic of byte code as well. Seems my speculation was right all along. Byte code is essentially a binary version of source code. That is constructs like classes, etc still exist. Apparently they do even in machine code but slightly more low level.

Ideally what I wanted to happened was for class hierarchies to essentially be expanded, functions inlined, classes converted into globals, etc...

PHP being a dynamic language makes expanding classes (or their hierarchies) difficult although I still haven't accepted impossible. :P

In the next couple weeks I want to start work on a PHP based parser, syntax tree, etc...eventually test my theories until I've proven myself wrong. :offtopic: :drunk:

Cheers :)