Over on Dynamically Typed today, there's a new post discussing one of the banes of a coder's existence (can you tell how I feel about it?) - Eval is dead! Long live Eval!
Eval seems to be a hot topic of discussion lately, especially in light of the recent vBulletin exploits and past exploits in common applications such as phpMyAdmin. Eval is one of the functions in PHP which can execute arbitrary code. Generally eval is used either by inexperienced programmers for a variety of misguided reasons, or by people attempting to push the boundries of PHP.
Thankfully, he also includes Rasmus' infamous quote on the subject: If eval() is the answer, you're almost certainly asking the wrong question.
The post goes on to talk briefly about what eval is, how it works, and, thankfully, why it is such a bad idea to use it. Honestly, there are very, very few situations where I've used it - and most of those I went back and replaced with a varaible variables solution or the like.




