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']); } $array[0]['b'] *= 100; 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
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 17
Branch analysis from position: 27
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 = 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: 37
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 17
Branch analysis from position: 27
Branch analysis from position: 17
Branch analysis from position: 10
filename:       /in/gWG3V
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        FETCH_DIM_RW                                     $8      !0, 0
         12        ASSIGN_DIM_OP                *=               3          $8, 'b'
         13        OP_DATA                                                  100
   15    14        ECHO                                                     'Array+output+%28by+%27for%27%29%3A%0A'
   16    15        ASSIGN                                                   !3, 0
         16      > JMP                                                      ->25
   17    17    >   INIT_FCALL                                               'implode'
         18        SEND_VAL                                                 '%2C+'
         19        FETCH_DIM_R                                      ~11     !0, !3
         20        SEND_VAL                                                 ~11
         21        DO_ICALL                                         $12     
         22        CONCAT                                           ~13     $12, '%0A'
         23        ECHO                                                     ~13
   16    24        PRE_INC                                                  !3
         25    >   IS_SMALLER                                               !3, 3
         26      > JMPNZ                                                    ~15, ->17
   20    27    >   ECHO                                                     'Array+output+%28by+%27foreach%27%29%3A%0A'
   21    28      > FE_RESET_R                                       $16     !0, ->37
         29    > > FE_FETCH_R                                               $16, !2, ->37
   22    30    >   INIT_FCALL                                               'implode'
         31        SEND_VAL                                                 '%2C+'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $17     
         34        CONCAT                                           ~18     $17, '%0A'
         35        ECHO                                                     ~18
   21    36      > JMP                                                      ->29
         37    >   FE_FREE                                                  $16
   25    38        ECHO                                                     'Array+output+%28by+%27for%27%29%3A%0A'
   26    39        ASSIGN                                                   !3, 0
         40      > JMP                                                      ->49
   27    41    >   INIT_FCALL                                               'implode'
         42        SEND_VAL                                                 '%2C+'
         43        FETCH_DIM_R                                      ~20     !0, !3
         44        SEND_VAL                                                 ~20
         45        DO_ICALL                                         $21     
         46        CONCAT                                           ~22     $21, '%0A'
         47        ECHO                                                     ~22
   26    48        PRE_INC                                                  !3
         49    >   IS_SMALLER                                               !3, 3
         50      > JMPNZ                                                    ~24, ->41
   28    51    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.94 ms | 1400 KiB | 17 Q