3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo implode(', ', array_column(array(range(0, 4), range(0, 6), range(0, 5)), 2)), "\n"; if (! function_exists('array_column')) { function array_column($array, $column_key, $idx=NULL) { $result = array(); foreach ($array as $i => $item) { $result[$idx ? $item[$idx]: $i] = $item[$column_key]; } return $result; } } class Artist implements ArrayAccess { public $artist_name; function __construct($name) { $this->artist_name = $name; } function offsetGet($name) { return $this->$name; } function offsetExists($name) { return isset($this->$name); } function offsetSet($name, $value) { $this->$name = $value; } function offsetUnset($name) { unset($this->$name); } } $artists = array( new Artist('Dali'), new Artist('Picasso'), new Artist('Titian'), ); var_dump(array_column($artists, 'artist_name')); /*****/
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/3FtjD
function name:  (null)
number of ops:  53
compiled vars:  !0 = $artists
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'implode'
          1        SEND_VAL                                                 '%2C+'
          2        INIT_FCALL                                               'array_column'
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 4
          6        DO_ICALL                                         $1      
          7        INIT_ARRAY                                       ~2      $1
          8        INIT_FCALL                                               'range'
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 6
         11        DO_ICALL                                         $3      
         12        ADD_ARRAY_ELEMENT                                ~2      $3
         13        INIT_FCALL                                               'range'
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 5
         16        DO_ICALL                                         $4      
         17        ADD_ARRAY_ELEMENT                                ~2      $4
         18        SEND_VAL                                                 ~2
         19        SEND_VAL                                                 2
         20        DO_ICALL                                         $5      
         21        SEND_VAR                                                 $5
         22        DO_ICALL                                         $6      
         23        ECHO                                                     $6
         24        ECHO                                                     '%0A'
    4    25        INIT_FCALL                                               'function_exists'
         26        SEND_VAL                                                 'array_column'
         27        DO_ICALL                                         $7      
         28        BOOL_NOT                                         ~8      $7
         29      > JMPZ                                                     ~8, ->31
    5    30    >   DECLARE_FUNCTION                                         'array_column'
   14    31    >   DECLARE_CLASS                                            'artist'
   34    32        NEW                                              $9      'Artist'
         33        SEND_VAL_EX                                              'Dali'
         34        DO_FCALL                                      0          
         35        INIT_ARRAY                                       ~11     $9
   35    36        NEW                                              $12     'Artist'
         37        SEND_VAL_EX                                              'Picasso'
         38        DO_FCALL                                      0          
         39        ADD_ARRAY_ELEMENT                                ~11     $12
   36    40        NEW                                              $14     'Artist'
         41        SEND_VAL_EX                                              'Titian'
         42        DO_FCALL                                      0          
         43        ADD_ARRAY_ELEMENT                                ~11     $14
   33    44        ASSIGN                                                   !0, ~11
   38    45        INIT_FCALL                                               'var_dump'
         46        INIT_FCALL                                               'array_column'
         47        SEND_VAR                                                 !0
         48        SEND_VAL                                                 'artist_name'
         49        DO_ICALL                                         $17     
         50        SEND_VAR                                                 $17
         51        DO_ICALL                                                 
   39    52      > RETURN                                                   1

Function %00array_column%2Fin%2F3FtjD%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/3FtjD
function name:  array_column
number of ops:  19
compiled vars:  !0 = $array, !1 = $column_key, !2 = $idx, !3 = $result, !4 = $item, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
    6     3        ASSIGN                                                   !3, <array>
    7     4      > FE_RESET_R                                       $7      !0, ->16
          5    > > FE_FETCH_R                                       ~8      $7, !4, ->16
          6    >   ASSIGN                                                   !5, ~8
    8     7      > JMPZ                                                     !2, ->11
          8    >   FETCH_DIM_R                                      ~10     !4, !2
          9        QM_ASSIGN                                        ~11     ~10
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~11     !5
         12    >   FETCH_DIM_R                                      ~13     !4, !1
         13        ASSIGN_DIM                                               !3, ~11
         14        OP_DATA                                                  ~13
    7    15      > JMP                                                      ->5
         16    >   FE_FREE                                                  $7
   10    17      > RETURN                                                   !3
   11    18*     > RETURN                                                   null

End of function %00array_column%2Fin%2F3FtjD%3A5%240

Class Artist:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FtjD
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'artist_name'
          2        OP_DATA                                                  !0
   18     3      > RETURN                                                   null

End of function __construct

Function offsetget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FtjD
function name:  offsetGet
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   21     3*     > RETURN                                                   null

End of function offsetget

Function offsetexists:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FtjD
function name:  offsetExists
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2      > RETURN                                                   ~1
   24     3*     > RETURN                                                   null

End of function offsetexists

Function offsetset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FtjD
function name:  offsetSet
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   26     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   27     4      > RETURN                                                   null

End of function offsetset

Function offsetunset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3FtjD
function name:  offsetUnset
number of ops:  3
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   29     1        UNSET_OBJ                                                !0
   30     2      > RETURN                                                   null

End of function offsetunset

End of class Artist.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1409 KiB | 23 Q