Works for me:
$ cat recurses.php ; php -q recurses.php
<?php
class recurses {
static function factorial ($n) {
assert(is_int($n));
if ($n == 0) return 1;
return $n * self::factorial($n - 1);
}
}
echo "4! = ", recurses::factorial(4), "\n";
?>
4! = 24
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

