3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inputs = ["zbcwgmbpijcxu\"yins\"sfxn"]; $sum = 0; echo addslashes($inputs[0]); for($i = 0; $i<count($inputs); $i++){ $ns = addslashes($inputs[$i]); $matches = null; preg_match("/\\\\[^\\\"]/",$ns,$matches); $sum+=2; for($j = 0; $j<strlen($ns); $j++){ $sum++; //echo $ns[$j]; } if(count($matches)>0){ $sum+=2; } for($j=0; $j<strlen($ns); $j++){ if($ns[$j] === "\\" && $ns[$j+1] ==="\\"){ $sum-=2; } } $sum-= strlen($inputs[$i]); } echo $sum;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 9
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 34
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 9
Branch analysis from position: 54
Branch analysis from position: 9
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 34
Branch analysis from position: 47
Branch analysis from position: 34
Branch analysis from position: 43
Branch analysis from position: 41
Branch analysis from position: 32
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 23
Branch analysis from position: 28
Branch analysis from position: 23
filename:       /in/tM9hD
function name:  (null)
number of ops:  56
compiled vars:  !0 = $inputs, !1 = $sum, !2 = $i, !3 = $ns, !4 = $matches, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
    4     2        INIT_FCALL                                               'addslashes'
          3        FETCH_DIM_R                                      ~8      !0, 0
          4        SEND_VAL                                                 ~8
          5        DO_ICALL                                         $9      
          6        ECHO                                                     $9
    6     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->51
    7     9    >   INIT_FCALL                                               'addslashes'
         10        FETCH_DIM_R                                      ~11     !0, !2
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !3, $12
    8    14        ASSIGN                                                   !4, null
    9    15        INIT_FCALL                                               'preg_match'
         16        SEND_VAL                                                 '%2F%5C%5C%5B%5E%5C%22%5D%2F'
         17        SEND_VAR                                                 !3
         18        SEND_REF                                                 !4
         19        DO_ICALL                                                 
   10    20        ASSIGN_OP                                     1          !1, 2
   11    21        ASSIGN                                                   !5, 0
         22      > JMP                                                      ->25
   12    23    >   PRE_INC                                                  !1
   11    24        PRE_INC                                                  !5
         25    >   STRLEN                                           ~20     !3
         26        IS_SMALLER                                               !5, ~20
         27      > JMPNZ                                                    ~21, ->23
   15    28    >   COUNT                                            ~22     !4
         29        IS_SMALLER                                               0, ~22
         30      > JMPZ                                                     ~23, ->32
   16    31    >   ASSIGN_OP                                     1          !1, 2
   18    32    >   ASSIGN                                                   !5, 0
         33      > JMP                                                      ->44
   19    34    >   FETCH_DIM_R                                      ~26     !3, !5
         35        IS_IDENTICAL                                     ~27     ~26, '%5C'
         36      > JMPZ_EX                                          ~27     ~27, ->41
         37    >   ADD                                              ~28     !5, 1
         38        FETCH_DIM_R                                      ~29     !3, ~28
         39        IS_IDENTICAL                                     ~30     ~29, '%5C'
         40        BOOL                                             ~27     ~30
         41    > > JMPZ                                                     ~27, ->43
   20    42    >   ASSIGN_OP                                     2          !1, 2
   18    43    >   PRE_INC                                                  !5
         44    >   STRLEN                                           ~33     !3
         45        IS_SMALLER                                               !5, ~33
         46      > JMPNZ                                                    ~34, ->34
   23    47    >   FETCH_DIM_R                                      ~35     !0, !2
         48        STRLEN                                           ~36     ~35
         49        ASSIGN_OP                                     2          !1, ~36
    6    50        PRE_INC                                                  !2
         51    >   COUNT                                            ~39     !0
         52        IS_SMALLER                                               !2, ~39
         53      > JMPNZ                                                    ~40, ->9
   26    54    >   ECHO                                                     !1
         55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.11 ms | 1400 KiB | 17 Q