// calcul de : x + (x-1) + ... + 3 + 2 + 1 function somme($x) { if ($x <= 0) return 0; return $x + somme($x-1); } // appel $s = somme(8);