3v4l.org

run code in 500+ PHP versions simultaneously
<?php $search = 'hello my'; $search = explode(' ', $search); $query = "SELECT * FROM table WHERE string LIKE '%" . implode("%' OR string LIKE '%", $search) . "%'"; echo $query . "\n"; $query = "SELECT * FROM table WHERE string LIKE '%" . implode("%' AND string LIKE '%", $search) . "%'"; echo $query;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O7ejo
function name:  (null)
number of ops:  18
compiled vars:  !0 = $search, !1 = $query
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'hello+my'
    3     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '+'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $3      
          5        ASSIGN                                                       !0, $3
    4     6        FRAMELESS_ICALL_2                implode             ~5      '%25%27+OR+string+LIKE+%27%25', !0
          7        CONCAT                                               ~6      'SELECT+%2A+FROM+table+WHERE+string+LIKE+%27%25', ~5
          8        CONCAT                                               ~7      ~6, '%25%27'
          9        ASSIGN                                                       !1, ~7
    5    10        CONCAT                                               ~9      !1, '%0A'
         11        ECHO                                                         ~9
    6    12        FRAMELESS_ICALL_2                implode             ~10     '%25%27+AND+string+LIKE+%27%25', !0
         13        CONCAT                                               ~11     'SELECT+%2A+FROM+table+WHERE+string+LIKE+%27%25', ~10
         14        CONCAT                                               ~12     ~11, '%25%27'
         15        ASSIGN                                                       !1, ~12
    7    16        ECHO                                                         !1
    8    17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.3 ms | 3388 KiB | 14 Q