3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('MY_ORDER', [0 => 2, 1 => 3, 2 => 0, 8 => 1]); function keyfn($v) { echo "called for $v\n"; return MY_ORDER[$v]; } $array = [2, 2, 2, 1, 1, 0, 0, 8]; array_multisort(array_map('keyfn', $array), $array); var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
called for 2 called for 2 called for 2 called for 1 called for 1 called for 0 called for 0 called for 8 array ( 0 => 2, 1 => 2, 2 => 2, 3 => 8, 4 => 0, 5 => 0, 6 => 1, 7 => 1, )

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