3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arrOne = [1, 3, 4]; $arrTwo = [2, 5]; $newArr = []; foreach($arrOne as $key => $one) { switch($key) { case 1: $newArr[] = $arrTwo[0]; break; case 4: $newArr[] = $arrTwo[1]; break; } $newArr[] = $one; } if(count($newArr, 1) < 5) { $newArr[] = $arrTwo[1]; } print_r($newArr);
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 )

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:
52.94 ms | 1271 KiB | 4 Q