Missing from the documentation: gmp_init() return false in case it failed to parse $num
<?php
var_dump(gmp_init(""));
// returns "bool(false)" and not a GMP object as hinted by the documentation, it also triggers a Warning "PHP Warning: gmp_init(): Unable to convert variable to GMP - string is not an integer in php shell code on line 1"
?>