Alternative to eval()

Is there an alternative to eval() where I can evaluate a text input as part of the code? And also, why is it not a best practice to use the eval()?

  Discussion posts and replies are publicly visible