<?phpfunction fact($x) { if($x <= 1) return 1; else return gmp_mul($x,fact($x-1));}print gmp_strval(fact(1000))."\n";?>
Cet exemple va calculer factorielle de 1000 (un plutôt grand nombre) très vite.