3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = []; $arr["recently_viewed"] = ["priority" => 1, "no_of_products" =>1]; $arr["searched_based"] = ["priority" => 0, "no_of_products" =>4]; $arr["last_ordered_items"] = ["priority" => 3, "no_of_products" =>3]; $arr = array_filter($arr, function ($e) {return $e["priority"];}); uasort($arr, function($a, $b) { return $b['priority'] - $a['priority']; }); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E5bNa
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 'recently_viewed'
          2        OP_DATA                                                  <array>
    5     3        ASSIGN_DIM                                               !0, 'searched_based'
          4        OP_DATA                                                  <array>
    6     5        ASSIGN_DIM                                               !0, 'last_ordered_items'
          6        OP_DATA                                                  <array>
    8     7        INIT_FCALL                                               'array_filter'
          8        SEND_VAR                                                 !0
          9        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !0, $6
   10    13        INIT_FCALL                                               'uasort'
         14        SEND_REF                                                 !0
         15        DECLARE_LAMBDA_FUNCTION                          ~8      [1]
   12    16        SEND_VAL                                                 ~8
   10    17        DO_ICALL                                                 
   14    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E5bNa
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 'priority'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E5bNa
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        FETCH_DIM_R                                      ~2      !1, 'priority'
          3        FETCH_DIM_R                                      ~3      !0, 'priority'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
   12     6*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.31 ms | 1003 KiB | 16 Q