3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => 0, 'b' => 0, 'c' => 0, 'd' => 1, 'e' => 1, 'f' => 1 ]; array_multisort( array_map( function ($v) { static $counters = [0, 0]; return $counters[$v]++; }, $array ), $array, SORT_DESC ); var_export($array);
Output for git.master_jit, git.master
array ( 'd' => 1, 'a' => 0, 'e' => 1, 'b' => 0, 'f' => 1, 'c' => 0, )

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