3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ 'A1', 'A2', 'A5', 'A10', 'B2', 'B4', 'C10', 'B5', 'C1', 'B1', 'C2', ]; usort( $data, function($a, $b) { sscanf($a, '%[A-Z]%d', $ac, $ar); sscanf($b, '%[A-Z]%d', $bc, $br); return ($ar == $br) ? $ac <=> $bc : $ar <=> $br; } ); var_dump($data);
Output for git.master, git.master_jit, rfc.property-hooks
array(11) { [0]=> string(2) "A1" [1]=> string(2) "B1" [2]=> string(2) "C1" [3]=> string(2) "A2" [4]=> string(2) "B2" [5]=> string(2) "C2" [6]=> string(2) "B4" [7]=> string(2) "A5" [8]=> string(2) "B5" [9]=> string(3) "A10" [10]=> string(3) "C10" }

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:
46.39 ms | 402 KiB | 8 Q