Last active
March 29, 2017 06:16
-
-
Save rmamont/e281d534ad3a63f3ef0f3588fca73f09 to your computer and use it in GitHub Desktop.
Revisions
-
rmamont revised this gist
Mar 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,4 @@ function fctrl($num) { return $iter($num, 1); } echo fctrl(97), PHP_EOL; -
rmamont created this gist
Mar 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <?php function fctrl($num) { $iter = function($num, $acc) use (&$iter) { if ($num == 1) { return $acc; } return $iter($num - 1, $acc * $num); }; return $iter($num, 1); } echo fctrl(5), PHP_EOL;