What are some alternative approaches to storing and calculating expressions in a PHP configuration file?

Storing and calculating expressions in a PHP configuration file can lead to security vulnerabilities if not handled properly. One approach to mitigate this risk is to use a safe evaluation method, such as the `eval()` function in PHP. Another alternative is to store the expressions as strings and then evaluate them using a secure method like the `evalMath` library.

// Using the eval() function
$expression = "2 + 2";
$result = eval("return $expression;");
echo $result;

// Using the evalMath library
require 'evalmath.class.php';
$evalMath = new EvalMath();
$expression = "2 + 2";
$result = $evalMath->evaluate($expression);
echo $result;