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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.7 ms | 1400 KiB | 17 Q