3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = '123ABC5678'; $User_input = "2.3-2-2.1"; preg_match_all("/(.)/", $User_input, $pattern); $i=0; $str=""; foreach($pattern[1] as $val){ if(is_numeric($val)){ $str .= substr($string,$i,$val); $i=$i+$val; }else{ $str .= $val; //$i=$i+1; } } echo $str;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/5eg5G
function name:  (null)
number of ops:  25
compiled vars:  !0 = $string, !1 = $User_input, !2 = $pattern, !3 = $i, !4 = $str, !5 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '123ABC5678'
    3     1        ASSIGN                                                       !1, '2.3-2-2.1'
    5     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAL                                                     '%2F%28.%29%2F'
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
    7     7        ASSIGN                                                       !3, 0
    8     8        ASSIGN                                                       !4, ''
    9     9        FETCH_DIM_R                                          ~11     !2, 1
         10      > FE_RESET_R                                           $12     ~11, ->22
         11    > > FE_FETCH_R                                                   $12, !5, ->22
   11    12    >   FRAMELESS_ICALL_1                is_numeric          ~13     !5
         13      > JMPZ                                                         ~13, ->20
   12    14    >   FRAMELESS_ICALL_3                substr              ~14     !0, !3
         15        OP_DATA                                                      !5
         16        ASSIGN_OP                                         8          !4, ~14
   13    17        ADD                                                  ~16     !3, !5
         18        ASSIGN                                                       !3, ~16
   11    19      > JMP                                                          ->21
   15    20    >   ASSIGN_OP                                         8          !4, !5
    9    21    > > JMP                                                          ->11
         22    >   FE_FREE                                                      $12
   22    23        ECHO                                                         !4
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.01 ms | 2374 KiB | 14 Q