3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [1, 2, 3]; for ($i = 0; $i < count($arr); $i++) { if ($arr[$i] == 4) { $arr[] = 5; } if ($arr[$i] == 2) { $arr[] = 4; } echo $arr[$i] . "\n"; }
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 = 20, Position 2 = 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 8
filename:       /in/TmtkU
function name:  (null)
number of ops:  21
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->17
    6     3    >   FETCH_DIM_R                                      ~4      !0, !1
          4        IS_EQUAL                                                 ~4, 4
          5      > JMPZ                                                     ~5, ->8
    7     6    >   ASSIGN_DIM                                               !0
          7        OP_DATA                                                  5
   10     8    >   FETCH_DIM_R                                      ~7      !0, !1
          9        IS_EQUAL                                                 ~7, 2
         10      > JMPZ                                                     ~8, ->13
   11    11    >   ASSIGN_DIM                                               !0
         12        OP_DATA                                                  4
   14    13    >   FETCH_DIM_R                                      ~10     !0, !1
         14        CONCAT                                           ~11     ~10, '%0A'
         15        ECHO                                                     ~11
    5    16        PRE_INC                                                  !1
         17    >   COUNT                                            ~13     !0
         18        IS_SMALLER                                               !1, ~13
         19      > JMPNZ                                                    ~14, ->3
   15    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.95 ms | 1394 KiB | 13 Q