3v4l.org

run code in 300+ PHP versions simultaneously
<?php $prvi = [ 'jabolka' => 'Jabolka', 'hruske' => 'Hruške' ]; $drugi = [ 'borovnice' => 'Borovnice', 'pomarance' => 'Pomaranče' ]; array_splice_preserve_keys( $prvi, 1, null, $drugi ); echo '<pre>'.print_r($prvi, true).'</pre>'; function array_splice_preserve_keys(&$input, $offset, $length=null, $replacement=array()) { if (empty($replacement)) { return array_splice($input, $offset, $length); } $part_before = array_slice($input, 0, $offset, $preserve_keys=true); $part_removed = array_slice($input, $offset, $length, $preserve_keys=true); $part_after = array_slice($input, $offset+$length, null, $preserve_keys=true); $input = $part_before + $replacement + $part_after; return $part_removed; }
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [jabolka] => Jabolka [borovnice] => Borovnice [pomarance] => Pomaranče [hruske] => Hruške ) </pre>

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:
34.22 ms | 401 KiB | 8 Q