langleyfoxall/math_eval
Safely evaluate math expressions in PHP. langleyfoxall/math_eval parses and computes strings with operators, brackets, and common functions, ideal for user-defined formulas and configuration values without using eval(). Lightweight and easy to integrate in Laravel or any PHP app.
Adopt if:
sin(), log(), and variables).Look elsewhere if:
For Executives: "This package allows us to embed dynamic math calculations into our PHP 8.x product—such as custom pricing formulas, data transformations, or rule-based systems—without building a full engine or supporting HHVM. By adopting this lightweight solution, we can reduce development time by 30% for features like dynamic discounts or scientific tools. The removal of HHVM support simplifies our tech stack, and the tradeoff is minimal: we’d need to verify security and potentially maintain a wrapper. For a $0 cost, this is a high-leverage way to add flexibility to our roadmap, especially if we’re already on PHP 8.x."
For Engineering:
*"The math_eval package (v2.0.0) is now PHP 8.x-only, dropping HHVM support. Key updates:
sin(), log()).How can I help you explore Laravel packages today?