3v4l.org

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

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/apvt3
function name:  f
number of ops:  7
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        ADD                                              ~2      !0, !1
          3        MOD                                              ~3      ~2, 5
          4        ADD                                              ~4      ~3, 1
          5      > RETURN                                                   ~4
    6     6*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.7 ms | 1403 KiB | 16 Q