3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("100_1", "100_2", "100_3", "100_11", "111_1", "111_2", "111_11", "101_1", "102_1", "102_2", "103_1", "103_2", "103_3", "104_1", "104_2"); natsort($array); foreach($array as $value) { $parts = explode('_', $value); $result[$parts[0]] = $value; } $result = array_values($result); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 100_11 [1] => 101_1 [2] => 102_2 [3] => 103_3 [4] => 104_2 [5] => 111_11 )

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