3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2,3,4,5,6,7,8,9,10); foreach ($a as $k => $v) { if ($k < 2) continue; echo $v; } echo "\n"; foreach (new LimitIterator(InfiniteIterator(new ArrayIterator($a)), 2, count($a)) as $v) { echo $v; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 9
filename:       /in/cOsTs
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > FE_RESET_R                                       $4      !0, ->9
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->9
          3    >   ASSIGN                                                   !2, ~5
    4     4        IS_SMALLER                                               !2, 2
          5      > JMPZ                                                     ~7, ->7
          6    > > JMP                                                      ->2
    5     7    >   ECHO                                                     !1
    3     8      > JMP                                                      ->2
          9    >   FE_FREE                                                  $4
    7    10        ECHO                                                     '%0A'
    8    11        NEW                                              $8      'LimitIterator'
         12        INIT_FCALL_BY_NAME                                       'InfiniteIterator'
         13        NEW                                              $9      'ArrayIterator'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
         16        SEND_VAR_NO_REF_EX                                       $9
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR_NO_REF_EX                                       $11
         19        SEND_VAL_EX                                              2
         20        COUNT                                            ~12     !0
         21        SEND_VAL_EX                                              ~12
         22        DO_FCALL                                      0          
         23      > FE_RESET_R                                       $14     $8, ->27
         24    > > FE_FETCH_R                                               $14, !1, ->27
    9    25    >   ECHO                                                     !1
    8    26      > JMP                                                      ->24
         27    >   FE_FREE                                                  $14
   10    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.21 ms | 1395 KiB | 13 Q