3v4l.org

run code in 300+ PHP versions simultaneously
<?php function escape_string($s) { $r = ''; for($i=0;@$s[$i];$i++) { if($s[$i]!='\'') if($s[$i]!='"') if($s[$i]!='\\') if($s[$i]!="\n") if($s[$i]!="\r") if($s[$i]!="\x1a") { $r .= $s[$i]; continue; } $r .= '?'; } return $r; } $password = '{$help}}'; $password = escape_string($SERVER_[aa]); $query = "select 1 from auth where password='{$password}'"; echo($query); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdci3
function name:  (null)
number of ops:  13
compiled vars:  !0 = $password, !1 = $SERVER_, !2 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ASSIGN                                                   !0, '%7B%24help%7D%7D'
   25     1        INIT_FCALL                                               'escape_string'
          2        FETCH_CONSTANT                                   ~4      'aa'
          3        FETCH_DIM_R                                      ~5      !1, ~4
          4        SEND_VAL                                                 ~5
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !0, $6
   26     7        ROPE_INIT                                     3  ~9      'select+1+from+auth+where+password%3D%27'
          8        ROPE_ADD                                      1  ~9      ~9, !0
          9        ROPE_END                                      2  ~8      ~9, '%27'
         10        ASSIGN                                                   !2, ~8
   27    11        ECHO                                                     !2
   28    12      > RETURN                                                   1

Function escape_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 4
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 4
Branch analysis from position: 31
Branch analysis from position: 4
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 4
Branch analysis from position: 31
Branch analysis from position: 4
Branch analysis from position: 25
Branch analysis from position: 25
Branch analysis from position: 25
Branch analysis from position: 25
Branch analysis from position: 25
filename:       /in/gdci3
function name:  escape_string
number of ops:  33
compiled vars:  !0 = $s, !1 = $r, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
          2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->27
    7     4    >   FETCH_DIM_R                                      ~5      !0, !2
          5        IS_NOT_EQUAL                                             ~5, '%27'
          6      > JMPZ                                                     ~6, ->25
    8     7    >   FETCH_DIM_R                                      ~7      !0, !2
          8        IS_NOT_EQUAL                                             ~7, '%22'
          9      > JMPZ                                                     ~8, ->25
    9    10    >   FETCH_DIM_R                                      ~9      !0, !2
         11        IS_NOT_EQUAL                                             ~9, '%5C'
         12      > JMPZ                                                     ~10, ->25
   10    13    >   FETCH_DIM_R                                      ~11     !0, !2
         14        IS_NOT_EQUAL                                             ~11, '%0A'
         15      > JMPZ                                                     ~12, ->25
   11    16    >   FETCH_DIM_R                                      ~13     !0, !2
         17        IS_NOT_EQUAL                                             ~13, '%0D'
         18      > JMPZ                                                     ~14, ->25
   12    19    >   FETCH_DIM_R                                      ~15     !0, !2
         20        IS_NOT_EQUAL                                             ~15, '%1A'
         21      > JMPZ                                                     ~16, ->25
   14    22    >   FETCH_DIM_R                                      ~17     !0, !2
         23        ASSIGN_OP                                     8          !1, ~17
   15    24      > JMP                                                      ->26
   18    25    >   ASSIGN_OP                                     8          !1, '%3F'
    5    26    >   PRE_INC                                                  !2
         27    >   BEGIN_SILENCE                                    ~21     
         28        FETCH_DIM_R                                      ~22     !0, !2
         29        END_SILENCE                                              ~21
         30      > JMPNZ                                                    ~22, ->4
   21    31    > > RETURN                                                   !1
   23    32*     > RETURN                                                   null

End of function escape_string

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.23 ms | 1403 KiB | 14 Q