3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'a' => 1, 'b' => 2, 'c' => 3], [ 'a' => 4, 'b' => 5, 'c' => 6], [ 'a' => 7, 'b' => 8, 'c' => 9] ]; $column = array_column($array, 'a'); foreach ($array as &$val) { unset($val['a']); } foreach ($array as &$val) { } echo "Array output (by 'for'):\n"; for ($i = 0; $i < 3; ++$i) { echo implode(', ', $array[$i]) . "\n"; } echo "Array output (by 'foreach'):\n"; foreach ($array as $val) { echo implode(', ', $val) . "\n"; } echo "Array output (by 'for'):\n"; for ($i = 0; $i < 3; ++$i) { echo implode(', ', $array[$i]) . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 10
2 jumps found. (Code = 125) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 126) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 18
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 38
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 42
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 42
Branch analysis from position: 52
Branch analysis from position: 42
Branch analysis from position: 38
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 18
Branch analysis from position: 28
Branch analysis from position: 18
Branch analysis from position: 14
Branch analysis from position: 10
filename:       /in/7PXVc
function name:  (null)
number of ops:  53
compiled vars:  !0 = $array, !1 = $column, !2 = $val, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'array_column'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'a'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    9     6      > FE_RESET_RW                                      $7      !0, ->10
          7    > > FE_FETCH_RW                                              $7, !2, ->10
   10     8    >   UNSET_DIM                                                !2, 'a'
    9     9      > JMP                                                      ->7
         10    >   FE_FREE                                                  $7
   13    11      > FE_RESET_RW                                      $8      !0, ->14
         12    > > FE_FETCH_RW                                              $8, !2, ->14
         13    > > JMP                                                      ->12
         14    >   FE_FREE                                                  $8
   16    15        ECHO                                                     'Array+output+%28by+%27for%27%29%3A%0A'
   17    16        ASSIGN                                                   !3, 0
         17      > JMP                                                      ->26
   18    18    >   INIT_FCALL                                               'implode'
         19        SEND_VAL                                                 '%2C+'
         20        FETCH_DIM_R                                      ~10     !0, !3
         21        SEND_VAL                                                 ~10
         22        DO_ICALL                                         $11     
         23        CONCAT                                           ~12     $11, '%0A'
         24        ECHO                                                     ~12
   17    25        PRE_INC                                                  !3
         26    >   IS_SMALLER                                               !3, 3
         27      > JMPNZ                                                    ~14, ->18
   21    28    >   ECHO                                                     'Array+output+%28by+%27foreach%27%29%3A%0A'
   22    29      > FE_RESET_R                                       $15     !0, ->38
         30    > > FE_FETCH_R                                               $15, !2, ->38
   23    31    >   INIT_FCALL                                               'implode'
         32        SEND_VAL                                                 '%2C+'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                         $16     
         35        CONCAT                                           ~17     $16, '%0A'
         36        ECHO                                                     ~17
   22    37      > JMP                                                      ->30
         38    >   FE_FREE                                                  $15
   26    39        ECHO                                                     'Array+output+%28by+%27for%27%29%3A%0A'
   27    40        ASSIGN                                                   !3, 0
         41      > JMP                                                      ->50
   28    42    >   INIT_FCALL                                               'implode'
         43        SEND_VAL                                                 '%2C+'
         44        FETCH_DIM_R                                      ~19     !0, !3
         45        SEND_VAL                                                 ~19
         46        DO_ICALL                                         $20     
         47        CONCAT                                           ~21     $20, '%0A'
         48        ECHO                                                     ~21
   27    49        PRE_INC                                                  !3
         50    >   IS_SMALLER                                               !3, 3
         51      > JMPNZ                                                    ~23, ->42
   29    52    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.6 ms | 1400 KiB | 17 Q