<?php 

/**
 * 
 */
class var_operator
{
	
	function __construct()
	{
		# code...
	}

	function plus(...$x) {
		$res = 0;
		foreach ($x as $val) {
			$res += $val;
		}
		return $res;
	}

	function minus(...$x) {
		$res = 0;
		foreach ($x as $key => $val) {
			if($key === 0) {
				$res = $key;
			} else {
				$res -= $val;
			}
		}
		return $res;
	}

	function conditional($x, $y, $condition = "==") {
		switch ($condition) {
			case '==':
				return $this->equal_to($x, $y);
				break;

			case '!=':
				return $this->not_equal_to($x, $y);
				break;

			case '===':
				return $this->absolutely_equal_to($x, $y);
				break;

			case '!==':
				return $this->not_absolutely_equal_to($x, $y);
				break;

			case '>':
				return $this->greater_than($x, $y);
				break;

			case '<':
				return $this->less_than($x, $y);
				break;

			case '>=':
				return $this->greater_than_or_equal_to($x, $y);
				break;

			case '<=':
				return $this->less_than_or_equal_to($x, $y);
				break;
			
			default:
				return $this->equal_to($x, $y);
				break;
		}
	}

	function mul(...$x) {
		$res = 0;
		foreach ($x as $val) {
			$res = $res * $val;
		}
		return $res;
	}

	function greater_than($x, $y) {
		return $x > $y;
	}

	function less_than($x, $y) {
		return $x < $y;
	}

	function greater_than_or_equal_to($x, $y) {
		return $x >= $y;
	}

	function less_than_or_equal_to($x, $y) {
		return $x <= $y;
	}

	function equal_to($x, $y) {
		return $x == $y;
	}

	function absolutely_equal_to($x, $y) {
		return $x === $y;
	}

	function not_equal_to($x, $y) {
		return $x != $y;
	}

	function not_absolutely_equal_to($x, $y) {
		return $x !== $y;
	}
}