3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tables = [ [ 'key1' => 'value1', 'key2' => 'value2' ], [ 'key3' => 'value3', 'key4' => 'value4' ], ]; echo 'List Each' . \PHP_EOL; foreach ($tables as $table_array) { list(,$table) = each($table_array); var_dump($table); } echo \PHP_EOL; echo 'Array Shift'. \PHP_EOL; foreach ($tables as $table_array) { $table = array_shift($table_array); var_dump($table); } echo \PHP_EOL; echo 'Current Next' . \PHP_EOL; foreach ($tables as $table_array) { $table = current($table_array); var_dump($table); next($table_array); } echo \PHP_EOL; echo 'Current Next w/key' . \PHP_EOL; foreach ($tables as $table_array) { $key = key($table_array); $table = current($table_array); var_dump($key, $table); next($table_array); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 43
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 43
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 43
2 jumps found. (Code = 77) Position 1 = 47, Position 2 = 64
Branch analysis from position: 47
2 jumps found. (Code = 78) Position 1 = 48, Position 2 = 64
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
Branch analysis from position: 43
Branch analysis from position: 27
Branch analysis from position: 14
filename:       /in/8vie4
function name:  (null)
number of ops:  66
compiled vars:  !0 = $tables, !1 = $table_array, !2 = $table, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ECHO                                                     'List+Each%0A'
   16     2      > FE_RESET_R                                       $5      !0, ->14
          3    > > FE_FETCH_R                                               $5, !1, ->14
   17     4    >   INIT_FCALL_BY_NAME                                       'each'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $6      
          7        FETCH_LIST_R                                     $7      $6, 1
          8        ASSIGN                                                   !2, $7
          9        FREE                                                     $6
   18    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   16    13      > JMP                                                      ->3
         14    >   FE_FREE                                                  $5
   20    15        ECHO                                                     '%0A'
   22    16        ECHO                                                     'Array+Shift%0A'
   23    17      > FE_RESET_R                                       $10     !0, ->27
         18    > > FE_FETCH_R                                               $10, !1, ->27
   24    19    >   INIT_FCALL                                               'array_shift'
         20        SEND_REF                                                 !1
         21        DO_ICALL                                         $11     
         22        ASSIGN                                                   !2, $11
   25    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
   23    26      > JMP                                                      ->18
         27    >   FE_FREE                                                  $10
   27    28        ECHO                                                     '%0A'
   29    29        ECHO                                                     'Current+Next%0A'
   30    30      > FE_RESET_R                                       $14     !0, ->43
         31    > > FE_FETCH_R                                               $14, !1, ->43
   31    32    >   INIT_FCALL                                               'current'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $15     
         35        ASSIGN                                                   !2, $15
   32    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
   33    39        INIT_FCALL                                               'next'
         40        SEND_REF                                                 !1
         41        DO_ICALL                                                 
   30    42      > JMP                                                      ->31
         43    >   FE_FREE                                                  $14
   35    44        ECHO                                                     '%0A'
   37    45        ECHO                                                     'Current+Next+w%2Fkey%0A'
   38    46      > FE_RESET_R                                       $19     !0, ->64
         47    > > FE_FETCH_R                                               $19, !1, ->64
   39    48    >   INIT_FCALL                                               'key'
         49        SEND_VAR                                                 !1
         50        DO_ICALL                                         $20     
         51        ASSIGN                                                   !3, $20
   40    52        INIT_FCALL                                               'current'
         53        SEND_VAR                                                 !1
         54        DO_ICALL                                         $22     
         55        ASSIGN                                                   !2, $22
   41    56        INIT_FCALL                                               'var_dump'
         57        SEND_VAR                                                 !3
         58        SEND_VAR                                                 !2
         59        DO_ICALL                                                 
   42    60        INIT_FCALL                                               'next'
         61        SEND_REF                                                 !1
         62        DO_ICALL                                                 
   38    63      > JMP                                                      ->47
         64    >   FE_FREE                                                  $19
   43    65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.94 ms | 1405 KiB | 23 Q