3v4l.org

run code in 300+ PHP versions simultaneously
<?php $displays = array(); $displays['default'] = array('position' => 1); $displays['page_1'] = array('position' => 1); uasort($displays, function ($display1, $display2) { if ($display1['position'] != $display2['position']) { return $display1['position'] < $display2['position'] ? -1 : 1; } return 0; }); print_r($displays); uasort($displays, function ($display1, $display2) { if ($display1['position'] != $display2['position']) { return $display1['position'] < $display2['position'] ? -1 : 1; } return 0; }); print_r($displays);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J2Q5D
function name:  (null)
number of ops:  22
compiled vars:  !0 = $displays
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 'default'
          2        OP_DATA                                                  <array>
    5     3        ASSIGN_DIM                                               !0, 'page_1'
          4        OP_DATA                                                  <array>
    7     5        INIT_FCALL                                               'uasort'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJ2Q5D%3A7%240'
   12     8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   13    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   15    13        INIT_FCALL                                               'uasort'
         14        SEND_REF                                                 !0
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJ2Q5D%3A15%241'
   20    16        SEND_VAL                                                 ~7
         17        DO_ICALL                                                 
   21    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJ2Q5D%3A7%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
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
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J2Q5D
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $display1, !1 = $display2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        FETCH_DIM_R                                      ~2      !0, 'position'
          3        FETCH_DIM_R                                      ~3      !1, 'position'
          4        IS_NOT_EQUAL                                             ~2, ~3
          5      > JMPZ                                                     ~4, ->14
    9     6    >   FETCH_DIM_R                                      ~5      !0, 'position'
          7        FETCH_DIM_R                                      ~6      !1, 'position'
          8        IS_SMALLER                                               ~5, ~6
          9      > JMPZ                                                     ~7, ->12
         10    >   QM_ASSIGN                                        ~8      -1
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~8      1
         13    > > RETURN                                                   ~8
   11    14    > > RETURN                                                   0
   12    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJ2Q5D%3A7%240

Function %00%7Bclosure%7D%2Fin%2FJ2Q5D%3A15%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
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
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J2Q5D
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $display1, !1 = $display2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        FETCH_DIM_R                                      ~2      !0, 'position'
          3        FETCH_DIM_R                                      ~3      !1, 'position'
          4        IS_NOT_EQUAL                                             ~2, ~3
          5      > JMPZ                                                     ~4, ->14
   17     6    >   FETCH_DIM_R                                      ~5      !0, 'position'
          7        FETCH_DIM_R                                      ~6      !1, 'position'
          8        IS_SMALLER                                               ~5, ~6
          9      > JMPZ                                                     ~7, ->12
         10    >   QM_ASSIGN                                        ~8      -1
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~8      1
         13    > > RETURN                                                   ~8
   19    14    > > RETURN                                                   0
   20    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJ2Q5D%3A15%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.69 ms | 1392 KiB | 17 Q