16        int $numberOfPeriods = 0,
 
   17        float $presentValue = 0,
 
   18        float $futureValue = 0,
 
   19        int $type = FinancialConstants::PAYMENT_END_OF_PERIOD
 
   22        $capital = $presentValue;
 
   25        for (
$i = 1; 
$i <= $period; ++
$i) {
 
   26            $interest = (
$type === FinancialConstants::PAYMENT_BEGINNING_OF_PERIOD && 
$i == 1) ? 0 : -$capital * $rate;
 
An exception for terminatinating execution or to throw for unit testing.
__construct(float $rate=0.0, int $period=0, int $numberOfPeriods=0, float $presentValue=0, float $futureValue=0, int $type=FinancialConstants::PAYMENT_END_OF_PERIOD)
static annuity( $interestRate, $numberOfPeriods, $presentValue, $futureValue=0, $type=FinancialConstants::PAYMENT_END_OF_PERIOD)
PMT.