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']); } 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(', ', $array) . "\n"; } echo "Array output (by $i):\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
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 14
Branch analysis from position: 24
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 34
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 34
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 41
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 41
Branch analysis from position: 51
Branch analysis from position: 41
Branch analysis from position: 34
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 14
Branch analysis from position: 24
Branch analysis from position: 14
Branch analysis from position: 10
filename:       /in/dtiu7
function name:  (null)
number of ops:  52
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        ECHO                                                     'Array+output+%28by+%27for%27%29%3A%0A'
   14    12        ASSIGN                                                   !3, 0
         13      > JMP                                                      ->22
   15    14    >   INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C+'
         16        FETCH_DIM_R                                      ~9      !0, !3
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                         $10     
         19        CONCAT                                           ~11     $10, '%0A'
         20        ECHO                                                     ~11
   14    21        PRE_INC                                                  !3
         22    >   IS_SMALLER                                               !3, 3
         23      > JMPNZ                                                    ~13, ->14
   18    24    >   ECHO                                                     'Array+output+%28by+%27foreach%27%29%3A%0A'
   19    25      > FE_RESET_R                                       $14     !0, ->34
         26    > > FE_FETCH_R                                               $14, !2, ->34
   20    27    >   INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 '%2C+'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $15     
         31        CONCAT                                           ~16     $15, '%0A'
         32        ECHO                                                     ~16
   19    33      > JMP                                                      ->26
         34    >   FE_FREE                                                  $14
   23    35        ROPE_INIT                                     3  ~18     'Array+output+%28by+'
         36        ROPE_ADD                                      1  ~18     ~18, !3
         37        ROPE_END                                      2  ~17     ~18, '%29%3A%0A'
         38        ECHO                                                     ~17
   24    39        ASSIGN                                                   !3, 0
         40      > JMP                                                      ->49
   25    41    >   INIT_FCALL                                               'implode'
         42        SEND_VAL                                                 '%2C+'
         43        FETCH_DIM_R                                      ~21     !0, !3
         44        SEND_VAL                                                 ~21
         45        DO_ICALL                                         $22     
         46        CONCAT                                           ~23     $22, '%0A'
         47        ECHO                                                     ~23
   24    48        PRE_INC                                                  !3
         49    >   IS_SMALLER                                               !3, 3
         50      > JMPNZ                                                    ~25, ->41
   26    51    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.7 ms | 1400 KiB | 17 Q