How to prevent script injection vulnerabilities when using eval() in PHP?

How to prevent script injection vulnerabilities when using eval() about his PHP? When utilizing perl, we can easily Write a script like this (working block): echo FOREENCODERS; echo DEPTH_VERSION; echo DEPTH_REVISION; echo echo DETAIL_READ_FROM_CODEPOVER; And, when performing some unit tests under your target host, we can run: $ php doshell $testfile.php