3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array =Array ( '0' => 'apple', '1' => 'Pear', '2' => 'orange', '3' => 'mango', '4' => '[banana]', '5' => 'Cantaloupe', '6' => 'Peach', ); $value_w_bracket = key(preg_grep('/\[\w+\]/i', $array)); $intermediate[0] = $array[$value_w_bracket]; unset($array[$value_w_bracket]); natcasesort($array); $final = array_merge($intermediate,$array); print_r($final); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => [banana] [1] => apple [2] => Cantaloupe [3] => mango [4] => orange [5] => Peach [6] => Pear )

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:
121.07 ms | 405 KiB | 5 Q