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); } next($items); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
Branch analysis from position: 2
Branch analysis from position: 10
filename:       /in/MDMcp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $items, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > JMP                                                      ->13
    6     2    >   CONCAT                                           ~3      !1, '%0A'
          3        ECHO                                                     ~3
    7     4        IS_EQUAL                                                 !1, 2
          5      > JMPZ                                                     ~4, ->10
    8     6    >   ASSIGN                                                   !1, 9
    9     7        INIT_FCALL                                               'prev'
          8        SEND_REF                                                 !0
          9        DO_ICALL                                                 
   11    10    >   INIT_FCALL                                               'next'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                                 
    5    13    >   INIT_FCALL                                               'current'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                           ~9      !1, $8
         17      > JMPNZ                                                    ~9, ->2
   12    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.12 ms | 1395 KiB | 19 Q