3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($current_day, $delay) { return ((($current_day+($delay-1))%5)+1); } for($i = 1; $i < 8; $i++) { printf("f(%d, 1) => %d\n", $i, f($i, 1)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/XRuS7
function name:  (null)
number of ops:  15
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->12
   10     2    >   INIT_FCALL                                               'printf'
          3        SEND_VAL                                                 'f%28%25d%2C+1%29+%3D%3E+%25d%0A'
          4        SEND_VAR                                                 !0
          5        INIT_FCALL                                               'f'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 1
          8        DO_FCALL                                      0  $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
    8    11        PRE_INC                                                  !0
         12    >   IS_SMALLER                                               !0, 8
         13      > JMPNZ                                                    ~5, ->2
   11    14    > > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XRuS7
function name:  f
number of ops:  8
compiled vars:  !0 = $current_day, !1 = $delay
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        SUB                                              ~2      !1, 1
          3        ADD                                              ~3      !0, ~2
          4        MOD                                              ~4      ~3, 5
          5        ADD                                              ~5      ~4, 1
          6      > RETURN                                                   ~5
    6     7*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.61 ms | 1389 KiB | 16 Q