3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ids = [4, 13, 6, 8, 10]; $names = ['alice', 'bob', 'charles', 'david', 'elizabeth']; $specialNameIndex = 2; $specialId = 13; unset($ids[array_search(13, $ids)]); array_unshift($ids, $specialId); var_export($ids); echo "\n---\n"; array_unshift($names, array_splice($names, 2, 1)[0]); var_export($names); echo "\n---\n"; var_export( array_combine( array_merge(array_splice($ids, array_search(13, $ids), 1), $ids), array_merge(array_splice($names, 2, 1), $names) ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 13, 1 => 4, 2 => 6, 3 => 8, 4 => 10, ) --- array ( 0 => 'charles', 1 => 'alice', 2 => 'bob', 3 => 'david', 4 => 'elizabeth', ) --- array ( 13 => 'bob', 4 => 'charles', 6 => 'alice', 8 => 'david', 10 => 'elizabeth', )

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