3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = array( array('TIR','tire',10), array('OIL','oil',100), array('SPK','spark',20) ); function compare($x,$y){ if($x[2] < $y[2]){ return 1; }else if($x > $y){ return -1; }else if($x[2] == $y[2]){ return 0; } } usort($products,"compare"); print_r($products); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cPrOF
function name:  (null)
number of ops:  9
compiled vars:  !0 = $products
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   24     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'compare'
          4        DO_ICALL                                                 
   26     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   29     8      > RETURN                                                   1

Function compare:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cPrOF
function name:  compare
number of ops:  18
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        FETCH_DIM_R                                      ~2      !0, 2
          3        FETCH_DIM_R                                      ~3      !1, 2
          4        IS_SMALLER                                               ~2, ~3
          5      > JMPZ                                                     ~4, ->8
   15     6    > > RETURN                                                   1
          7*       JMP                                                      ->17
   16     8    >   IS_SMALLER                                               !1, !0
          9      > JMPZ                                                     ~5, ->12
   17    10    > > RETURN                                                   -1
         11*       JMP                                                      ->17
   18    12    >   FETCH_DIM_R                                      ~6      !0, 2
         13        FETCH_DIM_R                                      ~7      !1, 2
         14        IS_EQUAL                                                 ~6, ~7
         15      > JMPZ                                                     ~8, ->17
   19    16    > > RETURN                                                   0
   21    17    > > RETURN                                                   null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.34 ms | 1396 KiB | 17 Q