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 = 'password0x270x270x270x27'; $password = escape_string($password); $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/j5uVN
function name:  (null)
number of ops:  11
compiled vars:  !0 = $password, !1 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ASSIGN                                                   !0, 'password0x270x270x270x27'
   25     1        INIT_FCALL                                               'escape_string'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   26     5        ROPE_INIT                                     3  ~6      'select+1+from+auth+where+password%3D%27'
          6        ROPE_ADD                                      1  ~6      ~6, !0
          7        ROPE_END                                      2  ~5      ~6, '%27'
          8        ASSIGN                                                   !1, ~5
   27     9        ECHO                                                     !1
   28    10      > 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/j5uVN
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.92 ms | 1394 KiB | 14 Q