<?php

$currentValues = [1, 2];
$newValues = [1, 3, 1, 4, 2];
print_r(array_merge($currentValues, array_diff($newValues, $currentValues)));