I've heard many places that PHP's eval
function is often not the answer. In light of PHP 5.3's LSB and closures we're running out of reasons to depend on eval
or create_function
.
Are there any conceivable cases where eval
is the best (only?) answer in PHP 5.3?
This question is not about whether eval
is evil in general, as it obviously is not.
Summary of Answers:
var_export
If you're writing malware and you want to make life hard for the sysadmin who's trying to clean up after you. That seems to be the most common usage case in my experience.