code: public static function FVSCHEDULE($principal, $schedule)
      {
          $principal = Functions::flattenSingleValue($principal);
          $schedule = Functions::flattenArray($schedule);
  
          foreach ($schedule as $rate) {
              $principal *= 1 + $rate;
          }
  
          return $principal;
      }
docs: FVSCHEDULE.
  
  Returns the future value of an initial principal after applying a series of compound interest rates.
  Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
  
  Excel Function:
  FVSCHEDULE(principal,schedule)
  
  @param float $principal the present value
  @param float[] $schedule an array of interest rates to apply
  
  @return float