code: public static function ACCRINTM($issue, $settlement, $rate, $par = 1000, $basis = 0)
      {
          $issue = Functions::flattenSingleValue($issue);
          $settlement = Functions::flattenSingleValue($settlement);
          $rate = Functions::flattenSingleValue($rate);
          $par = ($par === null) ? 1000 : Functions::flattenSingleValue($par);
          $basis = ($basis === null) ? 0 : Functions::flattenSingleValue($basis);
  
          //    Validate
          if ((is_numeric($rate)) && (is_numeric($par))) {
              $rate = (float) $rate;
              $par = (float) $par;
              if (($rate <= 0) || ($par <= 0)) {
                  return Functions::NAN();
              }
              $daysBetweenIssueAndSettlement = DateTime::YEARFRAC($issue, $settlement, $basis);
              if (!is_numeric($daysBetweenIssueAndSettlement)) {
                  //    return date error
                  return $daysBetweenIssueAndSettlement;
              }
  
              return $par * $rate * $daysBetweenIssueAndSettlement;
          }
  
          return Functions::VALUE();
      }
docs: ACCRINTM.
  
  Returns the accrued interest for a security that pays interest at maturity.
  
  Excel Function:
  ACCRINTM(issue,settlement,rate[,par[,basis]])
  
  @category Financial Functions
  
  @param mixed $issue The security's issue date
  @param mixed $settlement The security's settlement (or maturity) date
  @param float $rate The security's annual coupon rate
  @param float $par The security's par value.
  If you omit par, ACCRINT uses $1,000.
  @param int $basis The type of day count to use.
  0 or omitted    US (NASD) 30/360
  1                Actual/actual
  2                Actual/360
  3                Actual/365
  4                European 30/360
  
  @return float