3v4l.org

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

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

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.33 ms | 1396 KiB | 17 Q