3v4l.org

run code in 300+ PHP versions simultaneously
<?php $unsorted = [ "3470U11", "3470E11", "3470S13", "3470G11", "3470S12", "3470S11", "3470E12", "3470U12", "3470G13", "3470G12", "3470E13", "3470U13" ]; $sortBy = ['G', 'D', 'S', 'U', 'E', 'T', 'A', 'L']; $priority = array_flip($sortBy); usort( $unsorted, fn($a, $b) => ($priority[substr($a, -3, 1)] <=> $priority[substr($b, -3, 1)]) ?: $a <=> $b ); var_export ($unsorted);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => '3470G11', 1 => '3470G12', 2 => '3470G13', 3 => '3470S11', 4 => '3470S12', 5 => '3470S13', 6 => '3470U11', 7 => '3470U12', 8 => '3470U13', 9 => '3470E11', 10 => '3470E12', 11 => '3470E13', )

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