protected function _factorial($int) { if (!$int) { return 1; } $f = $int; while ($int > 1) { $f *= --$int; } return $f; }