Subtract with reference

@param string $arg1
@param string $arg2
@param int $scale
@return string
432404
public static function subtract2(& $arg1, $arg2, $scale = null) : string {
		$arg1 = self::subtract($arg1, $arg2, $scale);
		return $arg1;
	}
210659
public static function SubstringAfter( $arg1, $arg2 )
	{
		$str = $arg1 instanceof Undefined
		    ? ""
		    : $arg1 . "";

		$substr = $arg2 instanceof Undefined
		    ? ""
		    : $arg2 . "";

	    if ( strlen( $str . $substr ) === 0 ) return "";

		$index = strpos( $str, $substr );
		return $index === false
			? ""
		    : substr( $str, $index + strlen( $substr ) );
	}
656881
private function scale($r, $scale)
    {
        if ($scale < 0) {
            // The f sprintf type doesn't support negative numbers, so we
            // need to cludge things manually. First get the string.
            $r = sprintf('%.0f', (float)$r);
            // Due to floating point precision loss, $r will more than likely
            // look something like 4652999999999.9234. We grab one more digit
            // than we need to precise from $r and then use that to round
            // appropriately.
            $precise = (string)round(substr($r, 0, strlen($r) + $scale), -1);
            // Now we return it, truncating the zero that was rounded off.
            return substr($precise, 0, -1) . str_repeat('0', -$scale + 1);
        }
        return sprintf('%.' . $scale . 'f', (float)$r);
    }
1292961
private function mul($s1, $s2, $scale) {
        if ($this->bcmath) return bcmul($s1, $s2, $scale);
        else return $this->scale($s1 * $s2, $scale);
    }
391132
private static function __operator($function, $arg1, $arg2, $scale) : string {
		if (is_array($arg1)) {
			$arg1_temp = $arg1;
			$temp1 = array_shift($arg1_temp);
			foreach ($arg1_temp as $v) {
				$temp1 = call_user_func_array($function, [$temp1, $v . '', $scale]);
			}
		} else {
			$temp1 = $arg1;
		}
		if (is_array($arg2)) {
			$temp2 = array_shift($arg2);
			foreach ($arg2 as $v) {
				$temp2 = call_user_func_array($function, [$temp2, $v . '', $scale]);
			}
		} else {
			$temp2 = $arg2;
		}
		return call_user_func_array($function, [$temp1, $temp2, $scale]);
	}
386558
public static function compare($arg1, $arg2, $scale = null) : int {
		return bccomp($arg1 . '', $arg2 . '', $scale ?? self::$scale);
	}
574407
public static function subtractQuarter($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::QUARTER);
	}
634616
function Subtraction(Selectable $operand1, Selectable $operand2, $alias = '')
    {
        return $this->CreateSubtraction($operand1, $operand2, $alias);
    }
162980
public function Gt( $number, $scale = false )
	{
		$result = $this->Compare( $number, $scale );
		if ( $result === false ) return false;
		return $result == 1;
	}
1172171
public static function round($arg1, $scale = 0) : string {
		if (!isset($scale)) {
			$scale = self::$scale;
		}
		if ($arg1[0] != '-') {
			return bcadd($arg1, '0.' . str_repeat('0', $scale) . '5', $scale);
		} else {
			return bcsub($arg1, '0.' . str_repeat('0', $scale) . '5', $scale);
		}
	}
1280422
public static function mul($leftOperand, $rightOperand, ?int $scale = null): float
    {
        list($leftOperand, $rightOperand) = self::normalizeArgs($leftOperand, $rightOperand);

        if (null === $scale) {
            return (float)bcmul($leftOperand, $rightOperand);
        }

        return (float)bcmul($leftOperand, $rightOperand, $scale);
    }
665267
public static function floor($arg1, $scale = 0) : string {
		if ($arg1[0] != '-') {
			return bcadd($arg1, '0', $scale);
		} else {
			$value = '1';
			if ($scale != 0) {
				$value = self::divide('1', 10 ** $scale, $scale);
			}
			return bcsub($arg1, $value, $scale);
		}
	}
480504
public static function Add($op1, $op2, $scale = null)
    {
        $op1 = self::exponent($op1, $scale);
        $op2 = self::exponent($op2, $scale);

        return bcadd($op1, $op2, $scale);
    }
188640
public static function divide($arg1, $arg2, $scale = null) : string {
		return self::__operator('bcdiv', $arg1, $arg2, $scale ?? self::$scale);
	}
1216373
def subtract_and_get(self, delta):
        '''
        
        '''
        with self._reference.get_lock():
            self._reference.value -= delta
            return self._reference.value
816824
public static function min(array $args)
    {
        usort(
            $args,
            function ($a, $b) {
                return count($a) < count($b) ? 1 : -1;
            }
        );
        return count(end($args));
    }
984029
public function subtract($arg1) : \Object\Value\Math {
		\Math::subtract2($this->result, $arg1, $this->scale);
		return $this;
	}