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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.89 ms | 1392 KiB | 19 Q