Eval($_POST[cmd])
github.com
github.com
Why does eval() exist in so many programming languages, and when is using it not the worst possible option?
(1) Prints some info about the test that's about to execute
(2) Evals the command
(3) Checks/reports the result
Given the choice I'd rather use lambda, but not all languages make that very convenient/readable. In such languages, a carefully used eval might be preferable to ad-hoc interpretation.