3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = array(1, 2, 3, 4, 5); while ( $item = current($items) ) { echo $item."\n"; if ( $item == 2 ) { $item = 9; prev($items); prev($items); continue; } next($items); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 2
Branch analysis from position: 22
Branch analysis from position: 2
filename:       /in/GsHnh
function name:  (null)
number of ops:  23
compiled vars:  !0 = $items, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > JMP                                                      ->17
    6     2    >   CONCAT                                           ~3      !1, '%0A'
          3        ECHO                                                     ~3
    7     4        IS_EQUAL                                                 !1, 2
          5      > JMPZ                                                     ~4, ->14
    8     6    >   ASSIGN                                                   !1, 9
    9     7        INIT_FCALL                                               'prev'
          8        SEND_REF                                                 !0
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'prev'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                                 
   11    13      > JMP                                                      ->17
   13    14    >   INIT_FCALL                                               'next'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                                 
    5    17    >   INIT_FCALL                                               'current'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $9      
         20        ASSIGN                                           ~10     !1, $9
         21      > JMPNZ                                                    ~10, ->2
   14    22    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.68 ms | 1395 KiB | 19 Q