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);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y52lv
function name:  (null)
number of ops:  10
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'usort'
   19     2        SEND_REF                                                 !0
   20     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FY52lv%3A20%240'
   24     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   27     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FY52lv%3A20%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y52lv
function name:  {closure}
number of ops:  23
compiled vars:  !0 = $a, !1 = $b, !2 = $ac, !3 = $ar, !4 = $bc, !5 = $br
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        INIT_FCALL                                               'sscanf'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%25%5BA-Z%5D%25d'
          5        SEND_REF                                                 !2
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
   22     8        INIT_FCALL                                               'sscanf'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 '%25%5BA-Z%5D%25d'
         11        SEND_REF                                                 !4
         12        SEND_REF                                                 !5
         13        DO_ICALL                                                 
   23    14        IS_EQUAL                                                 !3, !5
         15      > JMPZ                                                     ~8, ->19
         16    >   SPACESHIP                                        ~9      !2, !4
         17        QM_ASSIGN                                        ~10     ~9
         18      > JMP                                                      ->21
         19    >   SPACESHIP                                        ~11     !3, !5
         20        QM_ASSIGN                                        ~10     ~11
         21    > > RETURN                                                   ~10
   24    22*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FY52lv%3A20%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.75 ms | 1401 KiB | 19 Q