code: public static function LCM(...$args)
      {
          $returnValue = 1;
          $allPoweredFactors = [];
          // Loop through arguments
          foreach (Functions::flattenArray($args) as $value) {
              if (!is_numeric($value)) {
                  return Functions::VALUE();
              }
              if ($value == 0) {
                  return 0;
              } elseif ($value < 0) {
                  return Functions::NAN();
              }
              $myFactors = self::factors(floor($value));
              $myCountedFactors = array_count_values($myFactors);
              $myPoweredFactors = [];
              foreach ($myCountedFactors as $myCountedFactor => $myCountedPower) {
                  $myPoweredFactors[$myCountedFactor] = pow($myCountedFactor, $myCountedPower);
              }
              foreach ($myPoweredFactors as $myPoweredValue => $myPoweredFactor) {
                  if (isset($allPoweredFactors[$myPoweredValue])) {
                      if ($allPoweredFactors[$myPoweredValue] < $myPoweredFactor) {
                          $allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
                      }
                  } else {
                      $allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
                  }
              }
          }
          foreach ($allPoweredFactors as $allPoweredFactor) {
              $returnValue *= (int) $allPoweredFactor;
          }
  
          return $returnValue;
      }
docs: LCM.
  
  Returns the lowest common multiplier of a series of numbers
  The least common multiple is the smallest positive integer that is a multiple
  of all integer arguments number1, number2, and so on. Use LCM to add fractions
  with different denominators.
  
  Excel Function:
  LCM(number1[,number2[, ...]])
  
  @category Mathematical and Trigonometric Functions
  
  @param mixed ...$args Data values
  
  @return int Lowest Common Multiplier