3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mapper = [ 10014869 => "A", 10010380 => "B", 10112932 => "C", 10113908 => "D", 10115620 => "E", 10014876 => "F", 10017457 => "G", 10010397 => "H" ]; $array = [ 1 => 10014869, 2 => 10014869, 3 => 10010380, 4 => 10112932, 5 => 10112932, 6 => 10113908, 7 => 10115620, 8 => 10014876, 9 => 10017457, 10 => 10010397, ]; foreach($array as $key => $value) { $array[$key] = $mapper[$value]; } print_r($array);
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
Array ( [1] => A [2] => A [3] => B [4] => C [5] => C [6] => D [7] => E [8] => F [9] => G [10] => H )

preferences:
82.03 ms | 407 KiB | 5 Q