3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2, 3); foreach ($a as $n => $e) { print_r(array($n, $e)); } $a = array(1, 2, 3); while (list($n, $e) = each ($a)) { print_r(array($n, $e)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 13
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 13
Branch analysis from position: 26
Branch analysis from position: 13
Branch analysis from position: 10
filename:       /in/UJZcl
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $e, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->10
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->10
          3    >   ASSIGN                                                   !2, ~5
    6     4        INIT_FCALL                                               'print_r'
          5        INIT_ARRAY                                       ~7      !2
          6        ADD_ARRAY_ELEMENT                                ~7      !1
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                                 
    5     9      > JMP                                                      ->2
         10    >   FE_FREE                                                  $4
    9    11        ASSIGN                                                   !0, <array>
   11    12      > JMP                                                      ->18
   12    13    >   INIT_FCALL                                               'print_r'
         14        INIT_ARRAY                                       ~10     !2
         15        ADD_ARRAY_ELEMENT                                ~10     !1
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                                 
   11    18    >   INIT_FCALL_BY_NAME                                       'each'
         19        SEND_VAR_EX                                              !0
         20        DO_FCALL                                      0  $12     
         21        FETCH_LIST_R                                     $13     $12, 0
         22        ASSIGN                                                   !2, $13
         23        FETCH_LIST_R                                     $15     $12, 1
         24        ASSIGN                                                   !1, $15
         25      > JMPNZ                                                    $12, ->13
   13    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.68 ms | 1396 KiB | 15 Q