hoa/math
Hoa\Math is a PHP library for mathematical expression evaluation, offering functions, constants, arithmetic visitors, combinatorics helpers, and random samplers. It lets applications parse and compute math expressions using extensible contexts.
Context of variables and functions) — the backbone of configurable pricing rules, discount engines, survey/scoring formulas, quote calculators, commission tiers, and "advanced filter" builders. Whether we build those features, and how, is a real roadmap decision this package informs.composer.json is an input to our PHP version upgrade roadmap (PHP 8.x readiness), our security review process, and our "how many unmaintained vendors do we tolerate" policy.composer require-ing it during a sprint and creating a maintenance obligation nobody owns.Consider it only when:
Calculator::evaluate(string $expr, array $vars): float) so it can be swapped later without touching product code.Look elsewhere when:
Reasonable maintained substitutes to evaluate instead: symfony/expression-language for safe expression evaluation, brick/math for arbitrary-precision arithmetic (already present in many Laravel dependency trees), and a focused math utility library for combinatorics/statistics. All three carry active maintainers, which is the property we actually need.
To executives: We evaluated a math utility library as a candidate dependency and are recommending against adopting it. It was archived in 2017, has no active maintainer, and no meaningful downstream adoption. The feature it would accelerate — configurable formulas for pricing and scoring — is deliverable with maintained alternatives at roughly the same engineering effort. The risk is asymmetric: adopting it saves days now and creates a PHP-upgrade and security-review liability that surfaces at the worst possible time, typically during a platform upgrade with a release already committed.
To engineering: Treat this as a reference implementation, not a dependency. Read the expression grammar and visitor pattern if we build an evaluator; ship with symfony/expression-language for user-authored formulas (sandboxed, maintained, Laravel-wrapped options exist) and brick/math for precision. If a legacy service already uses Hoa, isolate it behind a one-method interface, pin the version, and log it in the tech-debt register with an owner and a removal target.
What would change our mind: evidence that we already ship Hoa in production with a funded fork, or a specific math routine we cannot reasonably reimplement and cannot source elsewhere. Absent that, the decision is no — and it's cheap to make now, expensive to reverse later.
How can I help you explore Laravel packages today?