Page 1 of 1

Display processed PHP Code?

Posted: Sat Mar 25, 2006 5:03 pm
by waradmin
I know its possible to display the contents of say a .html file or even a .php file using PHP code. But, heres the kicker, is it possible to display the code after it has been processed by the PHP engine? And I am not asking about the output I am talking about the actual code.

So:
Request for file is made -> file is processed by PHP Engine -> the processed code is displayed but NOT the output, simply what the php encoder reads

I know this is a random question but if its possible let me know how, just wondering if its possible to send a file through the interpriter and then read the file contents once they have passed through.

Sorry for the randomness of this question.

Regards
-Steve

Posted: Sat Mar 25, 2006 5:06 pm
by John Cartwright
if you are running it through the php interpreter, then I'd say no. Although, there are some useful functions you can use, such as highlight_file(), highlight_string(), or change the php extension to phps

Posted: Sat Mar 25, 2006 5:08 pm
by feyd
what do you define as "what php encoder reads"? Maybe some examples of what you're looking for would help.

Posted: Sun Mar 26, 2006 6:40 pm
by waradmin
The only example I can think of is: a file is encoded as Zend, thus once the file passes through the Zend engine the code is processed into PHP readable code thus the output for the code would be the decoded code.

I know that sounds bad but I cant think of another way to explain it.

Posted: Sun Mar 26, 2006 6:52 pm
by feyd
last I checked, once php has done it's first pass, it is converted into opcodes. Is that what you're wanting to see? Or the code just prior to being converted?

Posted: Mon Mar 27, 2006 1:32 pm
by waradmin
After it has been processed by say the Zend Engine.

Posted: Mon Mar 27, 2006 1:41 pm
by Benjamin
A sure fire way to do that is to add some code to the php engine which writes the parsed php code to a file after it parses it & before it processes it. You would most likely have to recompile it.

Posted: Mon Mar 27, 2006 4:32 pm
by feyd
after it's been processed by the engine would be the output the file generates.

Posted: Fri Mar 31, 2006 4:37 pm
by waradmin
Im looking at more displaying the code the PHP engine recieves (after its passed through all decoders).

Posted: Fri Mar 31, 2006 5:05 pm
by feyd
Are you wanting to see what an encoded script has in it? Because outside of those, the source file would be what PHP's engine recieves.