3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["foo", "bar", "baz"]; for(reset($arr); list($k, $v) = each($arr);){ echo "$k => $v\n"; } echo "\n---\n"; foreach($arr as $k => $v){ echo "$k => $v\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/QERJQ
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr, !1 = $k, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'reset'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
          4      > JMP                                                      ->10
    6     5    >   ROPE_INIT                                     4  ~6      !1
          6        ROPE_ADD                                      1  ~6      ~6, '+%3D%3E+'
          7        ROPE_ADD                                      2  ~6      ~6, !2
          8        ROPE_END                                      3  ~5      ~6, '%0A'
          9        ECHO                                                     ~5
    5    10    >   INIT_FCALL_BY_NAME                                       'each'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $8      
         13        FETCH_LIST_R                                     $9      $8, 0
         14        ASSIGN                                                   !1, $9
         15        FETCH_LIST_R                                     $11     $8, 1
         16        ASSIGN                                                   !2, $11
         17      > JMPNZ                                                    $8, ->5
    9    18    >   ECHO                                                     '%0A---%0A'
   11    19      > FE_RESET_R                                       $13     !0, ->28
         20    > > FE_FETCH_R                                       ~14     $13, !2, ->28
         21    >   ASSIGN                                                   !1, ~14
   12    22        ROPE_INIT                                     4  ~17     !1
         23        ROPE_ADD                                      1  ~17     ~17, '+%3D%3E+'
         24        ROPE_ADD                                      2  ~17     ~17, !2
         25        ROPE_END                                      3  ~16     ~17, '%0A'
         26        ECHO                                                     ~16
   11    27      > JMP                                                      ->20
         28    >   FE_FREE                                                  $13
   13    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.33 ms | 1396 KiB | 18 Q