pear/math_biginteger
Pure-PHP arbitrary-precision integer library, the PEAR Math_BigInteger port. Adds, subtracts, multiplies, divides, powers, modPow, gcd, and random generation across bases, with optional GMP/BCMath acceleration. Useful for RSA, crypto, and big-number math without native extension requirements.
PHP_INT_MAX (Snowflake-style IDs, Twitter/Discord-style snowflakes, third-party order or transaction references) without silent float coercion. This package lets you prototype that path in pure PHP before committing to a schema or an extension dependency.BCMath/GMP is sufficient. It informs a "do we own numeric correctness?" conversation.ext-gmp or ext-bcmath — common on cheap shared hosting, some legacy PaaS images, and locked-down enterprise PHP builds. If that segment is in scope, it is a real (if temporary) enabler; if not, it is dead weight.BCMath is the correct, cheaper answer.Consider only when all of the following hold:
BCMath (bundled and enabled by default in essentially all standard PHP builds) or GMP — not "it's inconvenient," but "the host contract forbids it."Look elsewhere in almost every other case:
ext-bcmath / ext-gmp — the default answer. Native, fast, maintained by php-src, present in standard builds.brick/math — the modern, actively maintained, well-tested PHP arbitrary-precision library with BigInteger, BigDecimal, and BigRational. This is the correct replacement for greenfield work; it is what this package should have become.phpseclib/phpseclib (BigInteger) — if the actual need is cryptographic, this is the maintained descendant of the same lineage, with security handling this package never had.moneyphp/money) — if the real requirement is currency arithmetic, a bigint primitive is the wrong abstraction and you will rebuild rounding rules badly.DECIMAL/NUMERIC columns plus BIGINT handle most "we need big numbers" requests with no application-layer library at all.Hard disqualifiers: anything PCI-, payment-, or auth-adjacent; anything with an SLA; anything you would have to explain to an auditor. An archived dependency in a money or crypto path is an automatic no.
To executives (30 seconds): This is a small, free (MIT), pure-PHP math library for very large numbers. The important fact is that it is archived and unmaintained — it gets no security patches and no bug fixes. That makes it useful as a short-term prototyping aid and unsuitable as a permanent dependency in anything customer-facing or money-related. Recommendation: do not adopt as a platform dependency; if a team needs it for a constrained environment, time-box it and fund the migration to a maintained alternative.
To engineering leadership: It solves a narrow, real problem — arbitrary-precision integers without the GMP or BCMath extensions. That scenario is rarer than it used to be, since BCMath ships enabled by default. Where the constraint is real, the modern choice is brick/math (maintained, tested, same PHP-only tradeoff) or phpseclib for crypto. Cost to trial is trivial — an afternoon of vendoring and a benchmark — so the decision is cheap to make and cheap to reverse, provided we agree the exit criterion up front.
Ask: Approve a short evaluation spike against brick/math as the default recommendation, and record "archived dependencies are barred from payment, auth, and ledger paths" in the dependency policy. No budget required; the risk of not deciding is that someone quietly pulls this into a critical path because it was the first search result.
How can I help you explore Laravel packages today?