diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:33:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:33:51 +0000 |
commit | 4f0770f3df78ecd5dcaefbd214f7a1415366bca6 (patch) | |
tree | 72661b8f81594b855bcc967b819263f63fa30e17 /debian/perl-framework/t/htdocs/php/func3.php | |
parent | Adding upstream version 2.4.56. (diff) | |
download | apache2-4f0770f3df78ecd5dcaefbd214f7a1415366bca6.tar.xz apache2-4f0770f3df78ecd5dcaefbd214f7a1415366bca6.zip |
Adding debian version 2.4.56-1~deb11u2.debian/2.4.56-1_deb11u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/t/htdocs/php/func3.php')
-rw-r--r-- | debian/perl-framework/t/htdocs/php/func3.php | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/debian/perl-framework/t/htdocs/php/func3.php b/debian/perl-framework/t/htdocs/php/func3.php new file mode 100644 index 0000000..62cee15 --- /dev/null +++ b/debian/perl-framework/t/htdocs/php/func3.php @@ -0,0 +1,89 @@ +<?php + +old_function a ( + echo "hey\n"; +); + +function b($i) +{ + echo "$i\n"; +} + + +function c($i,$j) +{ + echo "Counting from $i to $j\n"; + for ($k=$i; $k<=$j; $k++) { + echo "$k\n"; + } +} + +a(); +b("blah"); +a(); +b("blah","blah"); +c(7,14); + +a(); + + +old_function factorial $n ( + if ($n==0 || $n==1) { + return 1; + } else { + return factorial($n-1)*$n; + } +); + +function factorial2($start, $n) +{ + if ($n<=$start) { + return $start; + } else { + return factorial2($start,$n-1)*$n; + } +} + + +for ($k=0; $k<10; $k++) { + for ($i=0; $i<=10; $i++) { + $n=factorial($i); + echo "factorial($i) = $n\n"; + } +} + + +echo "and now, from a function...\n"; + +old_function call_fact ( + echo "(it should break at 5...)\n"; + for ($i=0; $i<=10; $i++) { + if ($i == 5) break; + $n=factorial($i); + echo "factorial($i) = $n\n"; + } +); + +old_function return4 ( return 4; ); +old_function return7 ( return 7; ); + +for ($k=0; $k<10; $k++) { + call_fact(); +} + +echo "------\n"; +$result = factorial(factorial(3)); +echo "$result\n"; + +$result=factorial2(return4(),return7()); +echo "$result\n"; + +old_function andi $i, $j ( + for ($k=$i ; $k<=$j ; $k++) { + if ($k >5) continue; + echo "$k\n"; + } +); + +andi (3,10); + |