3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ ['name'=>'John B'], ['age'=>30], ['sizes'=> [ 'weight'=>80, 'height'=>120 ] ] ], [ ['name'=>'Marie B'], ['age'=>31], ['sizes'=> [ 'weight'=>60, 'height'=>110 ] ] ], [ ['name'=>'Carl M'], ['age'=>12], ['sizes'=> [ 'weight'=>70, 'height'=>100 ] ] ], [ ['name'=>'Mike N'], ['age'=>19], ['sizes'=> [ 'weight'=>70, 'height'=>150 ] ] ], [ ['name'=>'Nancy N'], ['age'=>15], ['sizes'=> [ 'weight'=>60, 'height'=>150 ] ] ], [ ['name'=>'Cory X'], ['age'=>15], ['sizes'=> [ 'weight'=>44, 'height'=>150 ] ] ] ]; function method($a,$b) { return ($a[2]["sizes"]["weight"] <= $b[2]["sizes"]["weight"]) ? -1 : 1; } usort($array, "method"); print_r($array); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jUEfY
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   70     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'method'
          4        DO_ICALL                                                 
   71     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   73     8      > RETURN                                                   1

Function method:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jUEfY
function name:  method
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   68     2        FETCH_DIM_R                                      ~2      !0, 2
          3        FETCH_DIM_R                                      ~3      ~2, 'sizes'
          4        FETCH_DIM_R                                      ~4      ~3, 'weight'
          5        FETCH_DIM_R                                      ~5      !1, 2
          6        FETCH_DIM_R                                      ~6      ~5, 'sizes'
          7        FETCH_DIM_R                                      ~7      ~6, 'weight'
          8        IS_SMALLER_OR_EQUAL                                      ~4, ~7
          9      > JMPZ                                                     ~8, ->12
         10    >   QM_ASSIGN                                        ~9      -1
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~9      1
         13    > > RETURN                                                   ~9
   69    14*     > RETURN                                                   null

End of function method

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.27 ms | 943 KiB | 18 Q