3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr[] = array('name'=>'test1', 'age'=>25); $arr[] = array('name'=>'test2', 'age'=>22); $arr[] = array('name'=>'test3', 'age'=>23); $arr[] = array('name'=>'test4', 'age'=>29); usort($arr, "cmp"); // USORT print_r($arr); function cmp($a, $b) { if ($a['age']==$b['age']) return 0; return ($a['age']<$b['age'])?-1:1; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XPgkV
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0
          2        OP_DATA                                                  <array>
    5     3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  <array>
    6     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  <array>
    7     7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  <array>
    8     9        INIT_FCALL                                               'usort'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 'cmp'
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   14    16      > RETURN                                                   1

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

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.8 ms | 1396 KiB | 17 Q