3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dow = array("mon","tue","wed","thu","fri","sat","sun"); $pick_a_day = 19; // NOT zero based foreach($dow as $inc => $an_element ) { $pick_a_day++; echo $dow[($pick_a_day+(count($dow))) % (count($dow))]." - loop number:".($inc+1)."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/dvASp
function name:  (null)
number of ops:  19
compiled vars:  !0 = $dow, !1 = $pick_a_day, !2 = $an_element, !3 = $inc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 19
    7     2      > FE_RESET_R                                       $6      !0, ->17
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->17
          4    >   ASSIGN                                                   !3, ~7
    9     5        PRE_INC                                                  !1
   10     6        COUNT                                            ~10     !0
          7        ADD                                              ~11     !1, ~10
          8        COUNT                                            ~12     !0
          9        MOD                                              ~13     ~11, ~12
         10        FETCH_DIM_R                                      ~14     !0, ~13
         11        CONCAT                                           ~15     ~14, '+-+loop+number%3A'
         12        ADD                                              ~16     !3, 1
         13        CONCAT                                           ~17     ~15, ~16
         14        CONCAT                                           ~18     ~17, '%0A'
         15        ECHO                                                     ~18
    7    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   13    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.25 ms | 1385 KiB | 13 Q