3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = "Hello ;\nDROP\nTABLE;\nSELECT\nWorld"; #explode ignores the \n but MySql accepts it as spaces $searchArray = explode(' ', $search); var_dump($searchArray); echo PHP_EOL . '----' . PHP_EOL; echo rtrim(str_repeat('title LIKE ? OR ', count($searchArray)), ' OR '); echo PHP_EOL . '----' . PHP_EOL; $parameters = array_map(function($value) { return $value . '%'; }, $searchArray); var_dump($parameters);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p8Rpg
function name:  (null)
number of ops:  31
compiled vars:  !0 = $search, !1 = $searchArray, !2 = $parameters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello+%3B%0ADROP%0ATABLE%3B%0ASELECT%0AWorld'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    6     9        ECHO                                                     '%0A----%0A'
    8    10        INIT_FCALL                                               'rtrim'
         11        INIT_FCALL                                               'str_repeat'
         12        SEND_VAL                                                 'title+LIKE+%3F+OR+'
         13        COUNT                                            ~7      !1
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        SEND_VAL                                                 '+OR+'
         18        DO_ICALL                                         $9      
         19        ECHO                                                     $9
    9    20        ECHO                                                     '%0A----%0A'
   11    21        INIT_FCALL                                               'array_map'
         22        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         23        SEND_VAL                                                 ~10
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $11     
         26        ASSIGN                                                   !2, $11
   12    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
         30      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p8Rpg
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        CONCAT                                           ~1      !0, '%25'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.46 ms | 1016 KiB | 18 Q