3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [0 => 0, 1 => 0, 2 => 8, 3 => 0, 11 => 0, 12 => 0, 15 => 0]; $arr2 = range(1,max($arr1)); // use array_diff to get the missing numbers and create a new array with them $missingNumbers = array_diff($arr1,$arr2); $keys = array_keys($missingNumbers); $Sonuc = array_replace(array_fill(min($keys), max($keys), 999), $arr1); print_r($Sonuc);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 0 [1] => 0 [2] => 8 [3] => 0 [4] => 999 [5] => 999 [6] => 999 [7] => 999 [8] => 999 [9] => 999 [10] => 999 [11] => 0 [12] => 0 [13] => 999 [14] => 999 [15] => 0 )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.77 ms | 406 KiB | 5 Q