3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Query(){ # read params $args = func_get_args(); # replace parameter after parameter, escape (SQL injection) and non-numeric encapsule with '' for($i=1; $i < Count($args); $i++){ if(get_magic_quotes_gpc() == 0) $arg = mysql_real_escape_string($args[$i]); else $arg = mysql_real_escape_string(stripslashes($args[$i])); $arg = strtr($arg, array('#'=>'[hash]')); if($arg != 'NULL') $arg = (is_numeric($arg))? $arg : "'".$arg."'"; $args[0] = substr_replace($args[0], $arg, strPos($args[0], '#'),1); } $args[0] .= ';'; return $args[0]; } $ID = 501; $check_sql = Query("update user_info set login_counter=login_counter+1, date_last_login=NOW() where id_twitter = #", $id); ECHO $check_sql;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIWpt
function name:  (null)
number of ops:  8
compiled vars:  !0 = $ID, !1 = $check_sql, !2 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, 501
   24     1        INIT_FCALL                                               'query'
          2        SEND_VAL                                                 'update+user_info+set+login_counter%3Dlogin_counter%2B1%2C+date_last_login%3DNOW%28%29+where+id_twitter+%3D+%23'
          3        SEND_VAR                                                 !2
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !1, $4
   26     6        ECHO                                                     !1
          7      > RETURN                                                   1

Function query:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 4
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 40
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 4
Branch analysis from position: 58
Branch analysis from position: 4
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 4
Branch analysis from position: 58
Branch analysis from position: 4
Branch analysis from position: 40
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 40
Branch analysis from position: 30
Branch analysis from position: 40
filename:       /in/sIWpt
function name:  Query
number of ops:  63
compiled vars:  !0 = $args, !1 = $i, !2 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FUNC_GET_ARGS                                    ~3      
          1        ASSIGN                                                   !0, ~3
    9     2        ASSIGN                                                   !1, 1
          3      > JMP                                                      ->55
   10     4    >   INIT_FCALL_BY_NAME                                       'get_magic_quotes_gpc'
          5        DO_FCALL                                      0  $6      
          6        IS_EQUAL                                                 $6, 0
          7      > JMPZ                                                     ~7, ->15
          8    >   INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
          9        CHECK_FUNC_ARG                                           
         10        FETCH_DIM_FUNC_ARG                               $8      !0, !1
         11        SEND_FUNC_ARG                                            $8
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !2, $9
         14      > JMP                                                      ->23
   11    15    >   INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         16        INIT_FCALL                                               'stripslashes'
         17        FETCH_DIM_R                                      ~11     !0, !1
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                         $12     
         20        SEND_VAR_NO_REF_EX                                       $12
         21        DO_FCALL                                      0  $13     
         22        ASSIGN                                                   !2, $13
   12    23    >   INIT_FCALL                                               'strtr'
         24        SEND_VAR                                                 !2
         25        SEND_VAL                                                 <array>
         26        DO_ICALL                                         $15     
         27        ASSIGN                                                   !2, $15
   14    28        IS_NOT_EQUAL                                             !2, 'NULL'
         29      > JMPZ                                                     ~17, ->40
         30    >   INIT_FCALL                                               'is_numeric'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $18     
         33      > JMPZ                                                     $18, ->36
         34    >   QM_ASSIGN                                        ~19     !2
         35      > JMP                                                      ->39
         36    >   CONCAT                                           ~20     '%27', !2
         37        CONCAT                                           ~21     ~20, '%27'
         38        QM_ASSIGN                                        ~19     ~21
         39    >   ASSIGN                                                   !2, ~19
   15    40    >   INIT_FCALL                                               'substr_replace'
         41        FETCH_DIM_R                                      ~24     !0, 0
         42        SEND_VAL                                                 ~24
         43        SEND_VAR                                                 !2
         44        INIT_FCALL                                               'strpos'
         45        FETCH_DIM_R                                      ~25     !0, 0
         46        SEND_VAL                                                 ~25
         47        SEND_VAL                                                 '%23'
         48        DO_ICALL                                         $26     
         49        SEND_VAR                                                 $26
         50        SEND_VAL                                                 1
         51        DO_ICALL                                         $27     
         52        ASSIGN_DIM                                               !0, 0
         53        OP_DATA                                                  $27
    9    54        PRE_INC                                                  !1
         55    >   COUNT                                            ~29     !0
         56        IS_SMALLER                                               !1, ~29
         57      > JMPNZ                                                    ~30, ->4
   18    58    >   ASSIGN_DIM_OP                .=               8          !0, 0
         59        OP_DATA                                                  '%3B'
   20    60        FETCH_DIM_R                                      ~32     !0, 0
         61      > RETURN                                                   ~32
   21    62*     > RETURN                                                   null

End of function query

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
257.32 ms | 1403 KiB | 28 Q