3v4l.org

run code in 300+ PHP versions simultaneously
<?php $someArray = array("key1" => "value1", "key2" => "value2", "key3" => "value3", "key4" => "value4"); $len = count($someArray); $i = 0; foreach($someArray AS $key => $value) { if($i == $len - 1) { echo "This is the last line!"; } else { echo "This is line $i\n"; } $i++; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/SGOZj
function name:  (null)
number of ops:  20
compiled vars:  !0 = $someArray, !1 = $len, !2 = $i, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        COUNT                                            ~6      !0
          2        ASSIGN                                                   !1, ~6
    5     3        ASSIGN                                                   !2, 0
    6     4      > FE_RESET_R                                       $9      !0, ->18
          5    > > FE_FETCH_R                                       ~10     $9, !3, ->18
          6    >   ASSIGN                                                   !4, ~10
    7     7        SUB                                              ~12     !1, 1
          8        IS_EQUAL                                                 !2, ~12
          9      > JMPZ                                                     ~13, ->12
    8    10    >   ECHO                                                     'This+is+the+last+line%21'
         11      > JMP                                                      ->16
   10    12    >   ROPE_INIT                                     3  ~15     'This+is+line+'
         13        ROPE_ADD                                      1  ~15     ~15, !2
         14        ROPE_END                                      2  ~14     ~15, '%0A'
         15        ECHO                                                     ~14
   13    16    >   PRE_INC                                                  !2
    6    17      > JMP                                                      ->5
         18    >   FE_FREE                                                  $9
   14    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.73 ms | 1394 KiB | 13 Q