about summary refs log tree commit diff
path: root/usth/ICT3.2/prac/4/4.php
diff options
context:
space:
mode:
Diffstat (limited to 'usth/ICT3.2/prac/4/4.php')
-rw-r--r--usth/ICT3.2/prac/4/4.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/usth/ICT3.2/prac/4/4.php b/usth/ICT3.2/prac/4/4.php
new file mode 100644
index 0000000..76bf52e
--- /dev/null
+++ b/usth/ICT3.2/prac/4/4.php
@@ -0,0 +1,5 @@
+<?php
+
+function factorial(int $n): int {
+    return $n > 1 ? $n * factorial($n - 1) : 1;
+}