This is more of an opinion question that an actual coding problem...
When I was first learning PHP I came across some material which said to always avoid using eval() whenever possible; because of the obvious security risks if you are not extremely careful.
There were times in the past when eval() looked pretty tempting, but I always looked for another solution to accomplish the same task, and have always been successful.
I've been using PHP for about 5 years (last 2 years full time) and I have never used eval() in an application. I honestly believe I have never even typed the function in while fooling around with scripts. Now, I understand I'm not writing any ground breaking code so there maybe situations which warrant its use, I just haven't come across them.
So my question is; should one avoid eval() like an ASP programmer avoids the truth?
[just kidding about the ASP programmer, I don't want to ruffle any feathers out there.]
When I was first learning PHP I came across some material which said to always avoid using eval() whenever possible; because of the obvious security risks if you are not extremely careful.
There were times in the past when eval() looked pretty tempting, but I always looked for another solution to accomplish the same task, and have always been successful.
I've been using PHP for about 5 years (last 2 years full time) and I have never used eval() in an application. I honestly believe I have never even typed the function in while fooling around with scripts. Now, I understand I'm not writing any ground breaking code so there maybe situations which warrant its use, I just haven't come across them.
So my question is; should one avoid eval() like an ASP programmer avoids the truth?
[just kidding about the ASP programmer, I don't want to ruffle any feathers out there.]