3v4l.org

run code in 300+ PHP versions simultaneously
<?php $promos = [ '123' => ['id' => '123', 'weight' => 1], '234' => ['id' => '234', 'weight' => 3], '345' => ['id' => '345', 'weight' => 2], ]; $cr['promos'] = [ '123' => ['id' => '123', 'weight' => 1], '234' => ['id' => '234', 'weight' => 3], '345' => ['id' => '345', 'weight' => 2], ]; $promo_weights = array_column($promos, 'weight', 'id'); array_multisort($promo_weights, SORT_ASC, $cr['promos']); var_dump($cr['promos']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j25Pq
function name:  (null)
number of ops:  20
compiled vars:  !0 = $promos, !1 = $cr, !2 = $promo_weights
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN_DIM                                               !1, 'promos'
   10     2        OP_DATA                                                  <array>
   15     3        INIT_FCALL                                               'array_column'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'weight'
          6        SEND_VAL                                                 'id'
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !2, $5
   17     9        INIT_FCALL                                               'array_multisort'
         10        SEND_REF                                                 !2
         11        SEND_VAL                                                 4
         12        FETCH_DIM_W                                      $7      !1, 'promos'
         13        SEND_REF                                                 $7
         14        DO_ICALL                                                 
   20    15        INIT_FCALL                                               'var_dump'
         16        FETCH_DIM_R                                      ~9      !1, 'promos'
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.96 ms | 1395 KiB | 19 Q