3v4l.org

run code in 500+ PHP versions simultaneously
<?php $fonts = array( 0 => ["index" => 0, "name" => "Arial", "path" => "assets/fonts/arial.ttf"], 1 => ["index" => 1, "name" => "Times", "path" => "assets/fonts/times.ttf"], 2 => ["index" => 2, "name" => "Roboto", "path" => "assets/fonts/roboto.ttf"], 3 => ["index" => 3, "name" => "AlexBrush", "path" => "assets/fonts/AlexBrush-Regular.ttf"], ); uasort($fonts, function($a, $b) { return strcmp($a['name'], $b['name']); }); $indexed_array = array_column($fonts,'name','index'); // array column map name by index print_r($indexed_array); echo $indexed_array[3]; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W7BOH
function name:  (null)
number of ops:  18
compiled vars:  !0 = $fonts, !1 = $indexed_array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        INIT_FCALL                                                   'uasort'
          2        SEND_REF                                                     !0
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   12     4        SEND_VAL                                                     ~3
   10     5        DO_ICALL                                                     
   16     6        INIT_FCALL                                                   'array_column'
          7        SEND_VAR                                                     !0
          8        SEND_VAL                                                     'name'
          9        SEND_VAL                                                     'index'
         10        DO_ICALL                                             $5      
         11        ASSIGN                                                       !1, $5
   17    12        INIT_FCALL                                                   'print_r'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                                     
   18    15        FETCH_DIM_R                                          ~8      !1, 3
         16        ECHO                                                         ~8
   19    17      > 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/W7BOH
function name:  {closure:/in/W7BOH:10}
number of ops:  10
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        INIT_FCALL                                                   'strcmp'
          3        FETCH_DIM_R                                          ~2      !0, 'name'
          4        SEND_VAL                                                     ~2
          5        FETCH_DIM_R                                          ~3      !1, 'name'
          6        SEND_VAL                                                     ~3
          7        DO_ICALL                                             $4      
          8      > RETURN                                                       $4
   12     9*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
196.58 ms | 2582 KiB | 17 Q