3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ ['space', 'Venus', 'NASA', 'apple'], ['link1', 'link2', 'link3', 'link4'], ]; // Convert the multiple dimensional array to avsingle $merged = array_combine(...$data); // Sort by key uksort($merged, fn($a, $b) => strcasecmp($a, $b)); var_dump($merged); // If it needs to be converted back to a multiple dimension array $data = [ array_keys($merged), array_values($merged), ]; var_dump($data);
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { ["apple"]=> string(5) "link4" ["NASA"]=> string(5) "link3" ["space"]=> string(5) "link1" ["Venus"]=> string(5) "link2" } array(2) { [0]=> array(4) { [0]=> string(5) "apple" [1]=> string(4) "NASA" [2]=> string(5) "space" [3]=> string(5) "Venus" } [1]=> array(4) { [0]=> string(5) "link4" [1]=> string(5) "link3" [2]=> string(5) "link1" [3]=> string(5) "link2" } }

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.82 ms | 1336 KiB | 4 Q