3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = [ ['number' => '419-1'], ['number' => '302-1'], ['number' => '102-1'], ['number' => '102-11'], ['number' => '203-1'], ['number' => '508-1'], ['number' => '105-1'], ['number' => '102-2'], ['number' => '302-2'], ]; $arr = $ar; usort($arr, function($a, $b) { return strnatcmp($a['number'], $b['number']); }); var_export($arr); echo \PHP_EOL . \PHP_EOL . '---------'.\PHP_EOL . \PHP_EOL; array_multisort(array_column($ar, 'number'), SORT_ASC, SORT_NATURAL, $ar); echo var_export($ar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNCe5
function name:  (null)
number of ops:  26
compiled vars:  !0 = $ar, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, !0
   17     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
   19     5        SEND_VAL                                                 ~4
   17     6        DO_ICALL                                                 
   20     7        INIT_FCALL                                               'var_export'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   22    10        ECHO                                                     '%0A%0A---------%0A%0A'
   24    11        INIT_FCALL                                               'array_multisort'
         12        INIT_FCALL                                               'array_column'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 'number'
         15        DO_ICALL                                         $7      
         16        SEND_VAL                                                 $7
         17        SEND_VAL                                                 4
         18        SEND_VAL                                                 6
         19        SEND_REF                                                 !0
         20        DO_ICALL                                                 
   25    21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $9      
         24        ECHO                                                     $9
         25      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BNCe5
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        INIT_FCALL                                               'strnatcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'number'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'number'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
   19     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1016 KiB | 18 Q