Exemple #1
0
 /**
  * This function calculates the sum of 2 variables
  * @access public
  * @author Eleri<*****@*****.**>
  * @return number result
  */
 public static function calculate()
 {
     if (isset($_GET['first'])) {
         Calculator::$firstVariable = filter_var($_GET['first'], FILTER_VALIDATE_FLOAT);
     }
     if (isset($_GET['second'])) {
         Calculator::$secondVariable = filter_var($_GET['second'], FILTER_VALIDATE_FLOAT);
     }
     $result = Calculator::$firstVariable + Calculator::$secondVariable;
     return $result;
 }