3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = new ArrayIterator(range(0,10)); foreach ($arr as $key => $value) { if ($value == 5 && empty($reset)) { $arr->rewind(); $reset = TRUE; } echo $value.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/e7aUD
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $value, !2 = $key, !3 = $reset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'ArrayIterator'
          1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 10
          4        DO_ICALL                                         $5      
          5        SEND_VAR_NO_REF_EX                                       $5
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $4
    5     8      > FE_RESET_R                                       $8      !0, ->22
          9    > > FE_FETCH_R                                       ~9      $8, !1, ->22
         10    >   ASSIGN                                                   !2, ~9
    6    11        IS_EQUAL                                         ~11     !1, 5
         12      > JMPZ_EX                                          ~11     ~11, ->15
         13    >   ISSET_ISEMPTY_CV                                 ~12     !3
         14        BOOL                                             ~11     ~12
         15    > > JMPZ                                                     ~11, ->19
    7    16    >   INIT_METHOD_CALL                                         !0, 'rewind'
         17        DO_FCALL                                      0          
    8    18        ASSIGN                                                   !3, <true>
   10    19    >   CONCAT                                           ~15     !1, '%0A'
         20        ECHO                                                     ~15
    5    21      > JMP                                                      ->9
         22    >   FE_FREE                                                  $8
   11    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.99 ms | 1395 KiB | 15 Q