3v4l.org

run code in 300+ PHP versions simultaneously
<?php $conns = [ 'foo' => 'foo', 'bar' => 'bar' ]; $ordering = ['foo' => 2, 'bar' => 1]; uksort($conns, function($a, $b) use ($ordering) { return $ordering[$a] > $ordering[$b]; }); var_dump($conns);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PrJJL
function name:  (null)
number of ops:  12
compiled vars:  !0 = $conns, !1 = $ordering
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
    9     2        INIT_FCALL                                               'uksort'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPrJJL%3A9%240'
          5        BIND_LEXICAL                                             ~4, !1
   11     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   13     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPrJJL%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PrJJL
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $ordering
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   10     3        FETCH_DIM_R                                      ~3      !2, !0
          4        FETCH_DIM_R                                      ~4      !2, !1
          5        IS_SMALLER                                       ~5      ~4, ~3
          6      > RETURN                                                   ~5
   11     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPrJJL%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.04 ms | 1395 KiB | 17 Q