3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "aa\" b \x27 c"; $sum = 0; $inputs = explode("\n", $input); echo addslashes($input); for($i = 0; $i<count($inputs); $i++){ $ns = addslashes($inputs[$i]); for($j = 0; $j<strlen($ns); $j++){ $sum++; if(preg_match("/\\^[\"]/",$ns)>0){ $sum+=2; } } //$sum-= strlen($inputs[$i]); } echo $sum;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 13
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 20
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 13
Branch analysis from position: 36
Branch analysis from position: 13
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 20
Branch analysis from position: 32
Branch analysis from position: 20
Branch analysis from position: 28
filename:       /in/gacNU
function name:  (null)
number of ops:  38
compiled vars:  !0 = $input, !1 = $sum, !2 = $inputs, !3 = $i, !4 = $ns, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'aa%22+b+%27+c'
    3     1        ASSIGN                                                   !1, 0
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    5     7        INIT_FCALL                                               'addslashes'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $10     
         10        ECHO                                                     $10
    6    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->33
    7    13    >   INIT_FCALL                                               'addslashes'
         14        FETCH_DIM_R                                      ~12     !2, !3
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                         $13     
         17        ASSIGN                                                   !4, $13
    8    18        ASSIGN                                                   !5, 0
         19      > JMP                                                      ->29
    9    20    >   PRE_INC                                                  !1
   10    21        INIT_FCALL                                               'preg_match'
         22        SEND_VAL                                                 '%2F%5C%5E%5B%22%5D%2F'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                         $17     
         25        IS_SMALLER                                               0, $17
         26      > JMPZ                                                     ~18, ->28
   11    27    >   ASSIGN_OP                                     1          !1, 2
    8    28    >   PRE_INC                                                  !5
         29    >   STRLEN                                           ~21     !4
         30        IS_SMALLER                                               !5, ~21
         31      > JMPNZ                                                    ~22, ->20
    6    32    >   PRE_INC                                                  !3
         33    >   COUNT                                            ~24     !2
         34        IS_SMALLER                                               !3, ~24
         35      > JMPNZ                                                    ~25, ->13
   17    36    >   ECHO                                                     !1
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.14 ms | 1400 KiB | 19 Q