3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dow = array("mon","tue","wed","thu","fri","sat","sun"); $pick_a_day = 6; // zero based foreach($dow as $inc => $an_element ) { echo $dow[($pick_a_day+(count($dow))) % (count($dow))]." - loop number:".($inc+1)."\n"; $pick_a_day++; } ?>
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/2eYiN
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, 6
    7     2      > FE_RESET_R                                       $6      !0, ->17
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->17
          4    >   ASSIGN                                                   !3, ~7
   10     5        COUNT                                            ~9      !0
          6        ADD                                              ~10     !1, ~9
          7        COUNT                                            ~11     !0
          8        MOD                                              ~12     ~10, ~11
          9        FETCH_DIM_R                                      ~13     !0, ~12
         10        CONCAT                                           ~14     ~13, '+-+loop+number%3A'
         11        ADD                                              ~15     !3, 1
         12        CONCAT                                           ~16     ~14, ~15
         13        CONCAT                                           ~17     ~16, '%0A'
         14        ECHO                                                     ~17
   11    15        PRE_INC                                                  !1
    7    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   14    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.02 ms | 1385 KiB | 13 Q