3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["foo" => "bar1", "hey" => "now"], ["foo" => "bar2", "hey" => "what"], [0 => "zero", 1 => "one"] ]; var_export(array_column($array, 'foo')); // get the column by name echo "\n---\n"; var_export(array_column($array, 0)); // don't need to be a string echo "\n---\n"; var_export(array_column($array, key(current($array)))); // access the first subarray, access its key echo "\n---\n"; var_export(array_column($array, array_shift(array_keys($array))));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hH79U
function name:  (null)
number of ops:  45
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'foo'
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
    9     8        ECHO                                                     '%0A---%0A'
   10     9        INIT_FCALL                                               'var_export'
         10        INIT_FCALL                                               'array_column'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        DO_ICALL                                         $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                                 
   11    16        ECHO                                                     '%0A---%0A'
   12    17        INIT_FCALL                                               'var_export'
         18        INIT_FCALL                                               'array_column'
         19        SEND_VAR                                                 !0
         20        INIT_FCALL                                               'key'
         21        INIT_FCALL                                               'current'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $6      
         24        SEND_VAR                                                 $6
         25        DO_ICALL                                         $7      
         26        SEND_VAR                                                 $7
         27        DO_ICALL                                         $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
   13    30        ECHO                                                     '%0A---%0A'
   14    31        INIT_FCALL                                               'var_export'
         32        INIT_FCALL                                               'array_column'
         33        SEND_VAR                                                 !0
         34        INIT_FCALL                                               'array_shift'
         35        INIT_FCALL                                               'array_keys'
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                         $10     
         38        SEND_VAR_NO_REF                               0          $10
         39        DO_ICALL                                         $11     
         40        SEND_VAR                                                 $11
         41        DO_ICALL                                         $12     
         42        SEND_VAR                                                 $12
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.97 ms | 1008 KiB | 19 Q