protected function determineChange($utxos, $outputs, $fee) {
        $inputsTotal = array_sum(array_map(function (UTXO $utxo) {
            return $utxo->value;
        }, $utxos));
        $outputsTotal = array_sum(array_column($outputs, 'value'));

        return $inputsTotal - $outputsTotal - $fee;
    }
protected function determineChange($utxos, $outputs, $fee) {
        $inputsTotal = array_sum(array_map(function (UTXO $utxo) {
            return $utxo->value;
        }, $utxos));
        $outputsTotal = array_sum(array_column($outputs, 'value'));

        return $inputsTotal - $outputsTotal - $fee;
    }
protected function determineChange ( $ utxos , $ outputs , $ fee ) { $ inputsTotal = array_sum ( array_map ( function ( UTXO $ utxo ) { return $ utxo -> value ; } , $ utxos ) ) ; $ outputsTotal = array_sum ( array_column ( $ outputs , 'value' ) ) ; return $ inputsTotal - $ outputsTotal - $ fee ; }
determine how much change is left over based on the inputs and outputs and the fee

@param UTXO[]    $utxos
@param array[]   $outputs
@param int       $fee
@return int
determine how much change is left over based on the inputs and outputs and the fee