3v4l.org

run code in 300+ PHP versions simultaneously
<?php $esas = array("portakal", "muz", "elma", "armut"); $ikame = array(0 => "karpuz", 4 => "kavun"); $ikame2 = array(0 => "kiraz"); $sepet = array_replace($esas, $ikame, $ikame2); print_r($sepet);
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.27, 8.0.0 - 8.0.15, 8.1.0 - 8.1.2
Array ( [0] => kiraz [1] => muz [2] => elma [3] => armut [4] => kavun )

preferences:
46.33 ms | 460 KiB | 5 Q