3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = 'a\' UNION (SELECT 1, fname, username, password FROM users);--'; $keywords = ["SELECT", "FROM", "WHERE", "LIKE", "AND", "OR", "ON","UNION", "JOIN"]; $patterns = '/\b(' . implode('|', $keywords) . ')\b/i'; $query = 'SELECT * FROM shopping WHERE title LIKE \'%%%s%%\''; if (preg_match($patterns, $search)) { $query = preg_replace($patterns, '$1JERRY', $query); } printf($query, $search);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/iVbBc
function name:  (null)
number of ops:  26
compiled vars:  !0 = $search, !1 = $keywords, !2 = $patterns, !3 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a%27+UNION+%28SELECT+1%2C+fname%2C+username%2C+password+FROM+users%29%3B--'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%7C'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        CONCAT                                           ~7      '%2F%5Cb%28', $6
          7        CONCAT                                           ~8      ~7, '%29%5Cb%2Fi'
          8        ASSIGN                                                   !2, ~8
    6     9        ASSIGN                                                   !3, 'SELECT+%2A+FROM+shopping+WHERE+title+LIKE+%27%25%25%25s%25%25%27'
    8    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $11     
         14      > JMPZ                                                     $11, ->21
    9    15    >   INIT_FCALL                                               'preg_replace'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 '%241JERRY'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !3, $12
   11    21    >   INIT_FCALL                                               'printf'
         22        SEND_VAR                                                 !3
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.23 ms | 1001 KiB | 17 Q