3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dow = array("mon","tue","wed","thu","fri","sat","sun"); $pick_a_day = 1; foreach($dow as $inc => $an_element ) { echo $dow[($pick_a_day+(count($dow))) % (count($dow))]." ".$pick_a_day."\n"; $pick_a_day++; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/el7on
function name:  (null)
number of ops:  18
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, 1
    7     2      > FE_RESET_R                                       $6      !0, ->16
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->16
          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, '+'
         11        CONCAT                                           ~15     ~14, !1
         12        CONCAT                                           ~16     ~15, '%0A'
         13        ECHO                                                     ~16
   11    14        PRE_INC                                                  !1
    7    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $6
   13    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.54 ms | 1393 KiB | 13 Q