3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = [ [1,3,5], [2,1,7], [3,5,9], [2,1,8] ]; $comparison = function ($a,$b) { // sort by index 1 first if($a[1] < $b[1]) return -1; if($a[1] > $b[1]) return 1; // if equal, sort by index 0 if($a[0] < $b[0]) return -1; if($a[0] > $b[0]) return 1; // otherwise sort by index 2 if($a[2] < $b[2]) return -1; if($a[2] > $b[2]) return 1; return 0; }; usort($test,$comparison); var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bhSNt
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test, !1 = $comparison
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbhSNt%3A10%240'
          2        ASSIGN                                                   !1, ~3
   27     3        INIT_FCALL                                               'usort'
          4        SEND_REF                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
   29     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbhSNt%3A10%240:
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 = 12
Branch analysis from position: 11
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
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bhSNt
function name:  {closure}
number of ops:  34
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_DIM_R                                      ~2      !0, 1
          3        FETCH_DIM_R                                      ~3      !1, 1
          4        IS_SMALLER                                               ~2, ~3
          5      > JMPZ                                                     ~4, ->7
          6    > > RETURN                                                   -1
   14     7    >   FETCH_DIM_R                                      ~5      !0, 1
          8        FETCH_DIM_R                                      ~6      !1, 1
          9        IS_SMALLER                                               ~6, ~5
         10      > JMPZ                                                     ~7, ->12
         11    > > RETURN                                                   1
   17    12    >   FETCH_DIM_R                                      ~8      !0, 0
         13        FETCH_DIM_R                                      ~9      !1, 0
         14        IS_SMALLER                                               ~8, ~9
         15      > JMPZ                                                     ~10, ->17
         16    > > RETURN                                                   -1
   18    17    >   FETCH_DIM_R                                      ~11     !0, 0
         18        FETCH_DIM_R                                      ~12     !1, 0
         19        IS_SMALLER                                               ~12, ~11
         20      > JMPZ                                                     ~13, ->22
         21    > > RETURN                                                   1
   21    22    >   FETCH_DIM_R                                      ~14     !0, 2
         23        FETCH_DIM_R                                      ~15     !1, 2
         24        IS_SMALLER                                               ~14, ~15
         25      > JMPZ                                                     ~16, ->27
         26    > > RETURN                                                   -1
   22    27    >   FETCH_DIM_R                                      ~17     !0, 2
         28        FETCH_DIM_R                                      ~18     !1, 2
         29        IS_SMALLER                                               ~18, ~17
         30      > JMPZ                                                     ~19, ->32
         31    > > RETURN                                                   1
   24    32    > > RETURN                                                   0
   25    33*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FbhSNt%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.76 ms | 1400 KiB | 17 Q