3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '17' => "x", '16' => "x", '15' => "x", '14' => "108.7000", '13' => "x", '12' => "x", '11' => "x", '10' => "x", '09' => "108.2635", '08' => "x", '07' => "x", '06' => "x", '05' => "x", '04' => "x", '03' => "x", '02' => "x", '01' => "x", '00' => "x", '23' => "x", '22' => "x", '21' => "x", '20' => "x", '19' => "x", '18' => "x" ]; foreach ($array as $k => $v) { if ($v === 'x') { $array[$k] =& $ref; } else { if (isset($ref)) { unset($ref); } $ref = $v; } } var_export($array);
Output for git.master_jit, git.master
array ( 17 => '108.7000', 16 => '108.7000', 15 => '108.7000', 14 => '108.7000', 13 => '108.7000', 12 => '108.7000', 11 => '108.7000', 10 => '108.7000', '09' => '108.2635', '08' => '108.2635', '07' => '108.2635', '06' => '108.2635', '05' => '108.2635', '04' => '108.2635', '03' => '108.2635', '02' => '108.2635', '01' => '108.2635', '00' => '108.2635', 23 => '108.2635', 22 => '108.2635', 21 => '108.2635', 20 => '108.2635', 19 => '108.2635', 18 => '108.2635', )

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:
67.47 ms | 406 KiB | 5 Q