with array_replace() no need to test foreach() loop