3v4l.org

run code in 300+ PHP versions simultaneously
<?php function escape_input($input) { return str_replace("'", "''", $input); } $a = "\' OR 1 = 1 --"; $b=CHAR(39); echo $b; echo "\n"; echo escape_input($a); echo "\n"; //$b = chr(0x27)."admin'--"; //echo escape_input($b); echo addslashes($b); echo "\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oXmbA
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%5C%27+OR+1+%3D+1+--'
    6     1        INIT_FCALL_BY_NAME                                       'CHAR'
          2        SEND_VAL_EX                                              39
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
    7     5        ECHO                                                     !1
    8     6        ECHO                                                     '%0A'
    9     7        INIT_FCALL                                               'escape_input'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $5      
         10        ECHO                                                     $5
   10    11        ECHO                                                     '%0A'
   13    12        INIT_FCALL                                               'addslashes'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
   14    16        ECHO                                                     '%0A'
   17    17      > RETURN                                                   1

Function escape_input:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oXmbA
function name:  escape_input
number of ops:  8
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%27'
          3        SEND_VAL                                                 '%27%27'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    4     7*     > RETURN                                                   null

End of function escape_input

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.96 ms | 1398 KiB | 18 Q