3v4l.org

run code in 300+ PHP versions simultaneously
<?php $query = "UPDATE `benefits` SET `ins_id`=:ins_id, `order`=:order WHERE `ben_id`=:ben_id"; $querydata = array(':ins_id' => 1001, ':order' => 1, ':ben_id' => 4004); echo "$query\n\n"; foreach($querydata AS $key=>$val) { echo preg_replace('/(.+?)('.$key.')(.*)/','$1' . $val . '$3', $query) . "\n"; //echo $query; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 20
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/BknBT
function name:  (null)
number of ops:  22
compiled vars:  !0 = $query, !1 = $querydata, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'UPDATE+%60benefits%60+SET+%60ins_id%60%3D%3Ains_id%2C+%60order%60%3D%3Aorder+WHERE+%60ben_id%60%3D%3Aben_id'
    4     1        ASSIGN                                                   !1, <array>
    5     2        NOP                                                      
          3        FAST_CONCAT                                      ~6      !0, '%0A%0A'
          4        ECHO                                                     ~6
    7     5      > FE_RESET_R                                       $7      !1, ->20
          6    > > FE_FETCH_R                                       ~8      $7, !2, ->20
          7    >   ASSIGN                                                   !3, ~8
    9     8        INIT_FCALL                                               'preg_replace'
          9        CONCAT                                           ~10     '%2F%28.%2B%3F%29%28', !3
         10        CONCAT                                           ~11     ~10, '%29%28.%2A%29%2F'
         11        SEND_VAL                                                 ~11
         12        CONCAT                                           ~12     '%241', !2
         13        CONCAT                                           ~13     ~12, '%243'
         14        SEND_VAL                                                 ~13
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $14     
         17        CONCAT                                           ~15     $14, '%0A'
         18        ECHO                                                     ~15
    7    19      > JMP                                                      ->6
         20    >   FE_FREE                                                  $7
   11    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.87 ms | 1399 KiB | 16 Q