Easiest way to convert PHP script to OpCode using C #?

What is the simplest way to convert PHP script (.php) to OpCode / Bytecode (opcode) using C #? I can use the DLL if I need to.

I need this to be done for a project I am working on in order to parse PHP code more easily.

Any thoughts or ideas are appreciated.

0


a source to share


2 answers


Phalanger is what you are looking for.



+1


a source


I don't think you can do a literal conversion as it is interpreted on the fly. You will essentially have to parse the PHP engine.



Each PHP engine will be different, and in another use case Phalanger just converts to the CLR, that is: it is not PHP anymore, so you will actually be parsing the .NET CLR.

0


a source







All Articles