An app we are building allows the client to upload PHP files.
After the file is uploaded, we want the app to be able to test that the uploaded PHP code works (at least that it does not cause any runtime errors).
I know that with Perl this can be done... that is that you can test that the syntax of the Perl code is correct. IE:
eval ($data);
die("Perl code may contain errors. Debug - $@") if($@);
(where $data contains the contents of the file and $@ is the Perl shorthand for error message)
Can this sort of thing be done with PHP? I've looked into eval and trapping any error messages using the "@" symbol -- no luck.
Anyone have any brilliant ideas?
Cheers