Jump to content

Checking if code can compile


terrordrone

Recommended Posts

Hello..

 

I am taking in php code (which returns a true or false) from a html textarea as input..  which i would like to run as some execution condition checking. I am then creating a anonymous function out of it using 'create_function'

 

However sometimes if the code is not right..  then i get some error...

 

Ideally i would like to check if the code submitted can compile during the input of the code itself.. 

 

I am aware that this is not a good idea... keeping in mind the security issues..

 

Keeping aside the security issues..  How do i go about this ? (checking if that piece of code submitted compiles right)

Link to comment
https://forums.phpfreaks.com/topic/173374-checking-if-code-can-compile/
Share on other sites

Yea..  sorry..  i meant syntax checking only..

 

Currently as i load the code from the database..  i am creating a anonymous function and then calling it..

 

so before putting it into the database.. i need to check if the syntax of the input code is right..

 

@corbin..  yea only a select few get to upload code...  I do not have a binary..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.