3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str ="it is a test string."; $y="r"; $x="m"; $len=strlen($str); if($str[0]==$y) { $str=substr_replace($str,$x,0,1); } if($len>=3) { for($i=3;$i<$len;$i+=4) { if($str[$i]==$y) { $str=substr_replace($str,$x,$i,1); } } } var_dump($str);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 19
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 19
Branch analysis from position: 32
Branch analysis from position: 19
Branch analysis from position: 29
Branch analysis from position: 32
Branch analysis from position: 15
filename:       /in/gdiW8
function name:  (null)
number of ops:  36
compiled vars:  !0 = $str, !1 = $y, !2 = $x, !3 = $len, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'it+is+a+test+string.'
    3     1        ASSIGN                                                   !1, 'r'
    4     2        ASSIGN                                                   !2, 'm'
    5     3        STRLEN                                           ~8      !0
          4        ASSIGN                                                   !3, ~8
    6     5        FETCH_DIM_R                                      ~10     !0, 0
          6        IS_EQUAL                                                 !1, ~10
          7      > JMPZ                                                     ~11, ->15
    8     8    >   INIT_FCALL                                               'substr_replace'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !0, $12
   10    15    >   IS_SMALLER_OR_EQUAL                                      3, !3
         16      > JMPZ                                                     ~14, ->32
   12    17    >   ASSIGN                                                   !4, 3
         18      > JMP                                                      ->30
   14    19    >   FETCH_DIM_R                                      ~16     !0, !4
         20        IS_EQUAL                                                 !1, ~16
         21      > JMPZ                                                     ~17, ->29
   16    22    >   INIT_FCALL                                               'substr_replace'
         23        SEND_VAR                                                 !0
         24        SEND_VAR                                                 !2
         25        SEND_VAR                                                 !4
         26        SEND_VAL                                                 1
         27        DO_ICALL                                         $18     
         28        ASSIGN                                                   !0, $18
   12    29    >   ASSIGN_OP                                     1          !4, 4
         30    >   IS_SMALLER                                               !4, !3
         31      > JMPNZ                                                    ~21, ->19
   20    32    >   INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.53 ms | 1465 KiB | 15 Q