Logo

GMP Functions

gmp_abs gmp_add gmp_and gmp_binomial gmp_clrbit gmp_cmp gmp_com gmp_div gmp_div_q gmp_div_qr gmp_div_r gmp_divexact gmp_export gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_import gmp_init gmp_intval gmp_invert gmp_jacobi gmp_kronecker gmp_lcm gmp_legendre gmp_mod gmp_mul gmp_neg gmp_nextprime gmp_or gmp_perfect_power gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random_bits gmp_random_range gmp_random_seed gmp_root gmp_rootrem gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_strval gmp_sub gmp_testbit gmp_xor

gmp_strval

Supported Versions: PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
Convert GMP number to string
<?php gmp_strval(GMP|int|string $num, int $base = 10): string
Logo laravel/framework laravel/framework
<?php     public function set($model, $key, $value, $attributes)

    {

        return gmp_strval($value, 10);

    }
tests/Integration/Database/EloquentModelCustomCastingTest.php
Logo laravel/framework laravel/framework
<?php     public function serialize($model, string $key, $value, array $attributes)

    {

        return gmp_strval($value, 10);

    }

}
tests/Integration/Database/EloquentModelCustomCastingTest.php
Logo symfony/var-dumper symfony/var-dumper
<?php {

    public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter): array

    {

        $a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp));



        return $a;

    }
Caster/GmpCaster.php