The documentation is pretty clear about `gmp_export()`: "Export a GMP number to a binary string". ;) It's actually an elaborate `pack()`; besides that it obviously works for large numbers, you cannot only choose endianess, but also the `$word_size`. _Originally posted by @cmb69 in https://github.com/php/php-src/issues/16418#issuecomment-2409076310_