3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array("A", "B", "C","D"); $flag =0; echo(current($list)); foreach ($list as $var) { if($flag==0) { reset($list); $flag=1; } echo next($list); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/qsN5S
function name:  (null)
number of ops:  21
compiled vars:  !0 = $list, !1 = $flag, !2 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
    4     2        INIT_FCALL                                               'current'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ECHO                                                     $5
    5     6      > FE_RESET_R                                       $6      !0, ->19
          7    > > FE_FETCH_R                                               $6, !2, ->19
    6     8    >   IS_EQUAL                                                 !1, 0
          9      > JMPZ                                                     ~7, ->14
    7    10    >   INIT_FCALL                                               'reset'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                                 
    8    13        ASSIGN                                                   !1, 1
   10    14    >   INIT_FCALL                                               'next'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $10     
         17        ECHO                                                     $10
    5    18      > JMP                                                      ->7
         19    >   FE_FREE                                                  $6
   11    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.11 ms | 1395 KiB | 19 Q