← All docs

gmp_init()

Creates a GMP number from an integer or string.

gmp_init()

function gmp_init(string|int $num, int $base = 0): object

Creates a GMP number from an integer or string.

Parameters:

  • $num (string|int)
  • $base (int), default 0, optional

Returns: object

Availability

Compiled (AOT)Magician (eval)
AvailableAvailable

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how gmp_init is implemented in the compiler, see the internals page.