3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\) VALUES (.+?(?=\)))/m'; $str = 'INSERT INTO table (`col1`, `col2`, `col3`) VALUES (\'oneVal\', \'twoVal\', \'threeVal\')'; $subst = ',`col4`) VALUES $1 , \'1\''; $result = preg_replace($re, $subst, $str); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rOQDG
function name:  (null)
number of ops:  11
compiled vars:  !0 = $re, !1 = $str, !2 = $subst, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2F%5C%29+VALUES+%28.%2B%3F%28%3F%3D%5C%29%29%29%2Fm'
    3     1        ASSIGN                                                   !1, 'INSERT+INTO+table+%28%60col1%60%2C+%60col2%60%2C+%60col3%60%29+VALUES+%28%27oneVal%27%2C+%27twoVal%27%2C+%27threeVal%27%29'
    4     2        ASSIGN                                                   !2, '%2C%60col4%60%29+VALUES+%241+%2C+%271%27'
    6     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    8     9        ECHO                                                     !3
    9    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.48 ms | 939 KiB | 16 Q