3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['name' => 'foo bar bar foo', 'qty' => 6], ['name' => 'bah', 'qty' => 5], ['name' => 'foo foo bar foo', 'qty' => 10], ['name' => 'foo', 'qty' => 6], ['name' => 'foo bar', 'qty' => 6], ['name' => 'bar', 'qty' => 11], ]; usort($array, function($a, $b) { return $b['qty'] <=> $a['qty'] ?: strlen($b['name']) <=> strlen($a['name']); }); var_export(array_column($array, 'qty', 'name'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dIMiO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   14     4        SEND_VAL                                                 ~2
   12     5        DO_ICALL                                                 
   16     6        INIT_FCALL                                               'var_export'
          7        INIT_FCALL                                               'array_column'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'qty'
         10        SEND_VAL                                                 'name'
         11        DO_ICALL                                         $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                                 
         14      > 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/dIMiO
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        FETCH_DIM_R                                      ~2      !1, 'qty'
          3        FETCH_DIM_R                                      ~3      !0, 'qty'
          4        SPACESHIP                                        ~4      ~2, ~3
          5        JMP_SET                                          ~5      ~4, ->12
          6        FETCH_DIM_R                                      ~6      !1, 'name'
          7        STRLEN                                           ~7      ~6
          8        FETCH_DIM_R                                      ~8      !0, 'name'
          9        STRLEN                                           ~9      ~8
         10        SPACESHIP                                        ~10     ~7, ~9
         11        QM_ASSIGN                                        ~5      ~10
         12      > RETURN                                                   ~5
   14    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.4 ms | 1005 KiB | 16 Q